You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by gdeconto <ge...@topproducer.com> on 2009/10/07 18:05:53 UTC
how can I use debugQuery if I have extended QParserPlugin?
in a previous post, I asked how I would go about creating virtual function in
my solr query; ie: http://127.0.0.1:8994/solr/select?q=@myFunc(1,2,3,4)
I was trying to find a way to more easily/cleanly perform queries against
large numbers of dynamic fields (ie field1, field2, field3...field99).
I have extended QParserPlugin so that I can do this. the extended method
replaces the virtual function section of the query with an expanded set of
fields; "@myFunc(1,2,3,4)" can become something like "(A1:1 AND B1:2 AND
C1:3 AND D1:4) OR (A2:1 AND B2:2 AND C2:3 AND D2:4) OR ... (A99:1 AND B99:2
AND C99:3 AND D99:4))"
one thing I noticed is that if I append debugQuery to a query that includes
the virtual function, I get a NullPointerException, likely because the
debugging code looks at the query passed in and not the expanded list that
my code generates.
I would like to be able to use debugQuery to analyse my queries, including
those with the virtual function.
What would I have to modify to get debugQuery to work??
thx in advance.
--
View this message in context: http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tp25789546p25789546.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: how can I use debugQuery if I have extended QParserPlugin?
Posted by gdeconto <ge...@topproducer.com>.
awesome. Thanks for figuring this out guys
wojtekpia wrote:
>
> Good catch. I was testing on a nightly build from mid-July. I just tested
> on a similar deployment with nightly code from Oct 5th and everything
> seems to work.
>
> My mid-July deployment breaks on sints, integers, sdouble, doubles, slongs
> and longs. My more recent deployment works with tints, sints, integers,
> tdoubles, sdoubles, doubles, tlongs, slongs, and longs. (I don't have any
> floats in my schema so I didn't test those). Sounds like another reason to
> upgrade to 1.4.
>
> Wojtek
>
--
View this message in context: http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tp25789546p25959707.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: how can I use debugQuery if I have extended QParserPlugin?
Posted by wojtekpia <wo...@hotmail.com>.
Good catch. I was testing on a nightly build from mid-July. I just tested on
a similar deployment with nightly code from Oct 5th and everything seems to
work.
My mid-July deployment breaks on sints, integers, sdouble, doubles, slongs
and longs. My more recent deployment works with tints, sints, integers,
tdoubles, sdoubles, doubles, tlongs, slongs, and longs. (I don't have any
floats in my schema so I didn't test those). Sounds like another reason to
upgrade to 1.4.
Wojtek
Yonik Seeley-3 wrote:
>
> Is this with trunk? I can't seem to reproduce this... what's the field
> type?
>
> -Yonik
> http://www.lucidimagination.com
>
> On Fri, Oct 16, 2009 at 3:01 PM, wojtekpia <wo...@hotmail.com> wrote:
>>
>> I'm seeing the same behavior and I don't have any custom query parsing
>> plugins. Similar to the original post, my queries like:
>>
>> select?q=field:[1 TO *]
>> select?q=field:[1 TO 2]
>> select?q=field:[1 TO 2]&debugQuery=true
>>
>> work correctly, but including an unboundd range appears to break the
>> debug
>> component:
>> select?q=field:[1 TO *]&debugQuery=true
>>
>> My stack trace is the same as the original post.
>>
>>
>> gdeconto wrote:
>>>
>>> my apologies, you are correct; I put the stack trace in an edit of the
>>> post and not in the original post.
>>>
>>> re version info:
>>>
>>> Solr Specification Version: 1.3.0.2009.07.08.08.05.45
>>> Solr Implementation Version: nightly exported - yonik - 2009-07-08
>>> 08:05:45
>>>
>>> NOTE: I have some more info on this NPE problem. I get the NPE error
>>> whenever I use debugQuery and the query range has an asterix in it, even
>>> tho the query itself should work. For example:
>>>
>>> These work ok:
>>>
>>> http://127.0.0.1:8994/solr/select?q=myfield:[* TO 1]
>>> http://127.0.0.1:8994/solr/select?q=myfield:[1 TO *]
>>> http://127.0.0.1:8994/solr/select?q=myfield:[1 TO 1000]
>>> http://127.0.0.1:8994/solr/select?q=myfield:[1 TO 1000]&debugQuery=true
>>>
>>> These do not work ok:
>>>
>>> http://127.0.0.1:8994/solr/select?q=myfield:[* TO 1]&debugQuery=true
>>> http://127.0.0.1:8994/solr/select?q=myfield:[1 TO *]&debugQuery=true
>>> http://127.0.0.1:8994/solr/select?q=myfield:*
>>> http://127.0.0.1:8994/solr/select?q=myfield:*&debugQuery=true
>>>
>>> Not sure if the * gets translated somewhere into a null value parameter
>>> (I
>>> am just starting to look at the solr code) per your comment
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tp25789546p25930610.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tp25789546p25932460.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: how can I use debugQuery if I have extended QParserPlugin?
Posted by Yonik Seeley <yo...@lucidimagination.com>.
Is this with trunk? I can't seem to reproduce this... what's the field type?
-Yonik
http://www.lucidimagination.com
On Fri, Oct 16, 2009 at 3:01 PM, wojtekpia <wo...@hotmail.com> wrote:
>
> I'm seeing the same behavior and I don't have any custom query parsing
> plugins. Similar to the original post, my queries like:
>
> select?q=field:[1 TO *]
> select?q=field:[1 TO 2]
> select?q=field:[1 TO 2]&debugQuery=true
>
> work correctly, but including an unboundd range appears to break the debug
> component:
> select?q=field:[1 TO *]&debugQuery=true
>
> My stack trace is the same as the original post.
>
>
> gdeconto wrote:
>>
>> my apologies, you are correct; I put the stack trace in an edit of the
>> post and not in the original post.
>>
>> re version info:
>>
>> Solr Specification Version: 1.3.0.2009.07.08.08.05.45
>> Solr Implementation Version: nightly exported - yonik - 2009-07-08
>> 08:05:45
>>
>> NOTE: I have some more info on this NPE problem. I get the NPE error
>> whenever I use debugQuery and the query range has an asterix in it, even
>> tho the query itself should work. For example:
>>
>> These work ok:
>>
>> http://127.0.0.1:8994/solr/select?q=myfield:[* TO 1]
>> http://127.0.0.1:8994/solr/select?q=myfield:[1 TO *]
>> http://127.0.0.1:8994/solr/select?q=myfield:[1 TO 1000]
>> http://127.0.0.1:8994/solr/select?q=myfield:[1 TO 1000]&debugQuery=true
>>
>> These do not work ok:
>>
>> http://127.0.0.1:8994/solr/select?q=myfield:[* TO 1]&debugQuery=true
>> http://127.0.0.1:8994/solr/select?q=myfield:[1 TO *]&debugQuery=true
>> http://127.0.0.1:8994/solr/select?q=myfield:*
>> http://127.0.0.1:8994/solr/select?q=myfield:*&debugQuery=true
>>
>> Not sure if the * gets translated somewhere into a null value parameter (I
>> am just starting to look at the solr code) per your comment
>>
>
> --
> View this message in context: http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tp25789546p25930610.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Re: how can I use debugQuery if I have extended QParserPlugin?
Posted by wojtekpia <wo...@hotmail.com>.
I'm seeing the same behavior and I don't have any custom query parsing
plugins. Similar to the original post, my queries like:
select?q=field:[1 TO *]
select?q=field:[1 TO 2]
select?q=field:[1 TO 2]&debugQuery=true
work correctly, but including an unboundd range appears to break the debug
component:
select?q=field:[1 TO *]&debugQuery=true
My stack trace is the same as the original post.
gdeconto wrote:
>
> my apologies, you are correct; I put the stack trace in an edit of the
> post and not in the original post.
>
> re version info:
>
> Solr Specification Version: 1.3.0.2009.07.08.08.05.45
> Solr Implementation Version: nightly exported - yonik - 2009-07-08
> 08:05:45
>
> NOTE: I have some more info on this NPE problem. I get the NPE error
> whenever I use debugQuery and the query range has an asterix in it, even
> tho the query itself should work. For example:
>
> These work ok:
>
> http://127.0.0.1:8994/solr/select?q=myfield:[* TO 1]
> http://127.0.0.1:8994/solr/select?q=myfield:[1 TO *]
> http://127.0.0.1:8994/solr/select?q=myfield:[1 TO 1000]
> http://127.0.0.1:8994/solr/select?q=myfield:[1 TO 1000]&debugQuery=true
>
> These do not work ok:
>
> http://127.0.0.1:8994/solr/select?q=myfield:[* TO 1]&debugQuery=true
> http://127.0.0.1:8994/solr/select?q=myfield:[1 TO *]&debugQuery=true
> http://127.0.0.1:8994/solr/select?q=myfield:*
> http://127.0.0.1:8994/solr/select?q=myfield:*&debugQuery=true
>
> Not sure if the * gets translated somewhere into a null value parameter (I
> am just starting to look at the solr code) per your comment
>
--
View this message in context: http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tp25789546p25930610.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: how can I use debugQuery if I have extended QParserPlugin?
Posted by gdeconto <ge...@topproducer.com>.
my apologies, you are correct; I put the stack trace in an edit of the post
and not in the original post.
re version info:
Solr Specification Version: 1.3.0.2009.07.08.08.05.45
Solr Implementation Version: nightly exported - yonik - 2009-07-08 08:05:45
NOTE: I have some more info on this NPE problem. I get the NPE error
whenever I use debugQuery and the query range has an asterix in it, even tho
the query itself should work. For example:
These work ok:
http://127.0.0.1:8994/solr/select?q=myfield:[* TO 1]
http://127.0.0.1:8994/solr/select?q=myfield:[1 TO *]
http://127.0.0.1:8994/solr/select?q=myfield:[1 TO 1000]
http://127.0.0.1:8994/solr/select?q=myfield:[1 TO 1000]&debugQuery=true
These do not work ok:
http://127.0.0.1:8994/solr/select?q=myfield:[* TO 1]&debugQuery=true
http://127.0.0.1:8994/solr/select?q=myfield:[1 TO *]&debugQuery=true
http://127.0.0.1:8994/solr/select?q=myfield:*
http://127.0.0.1:8994/solr/select?q=myfield:*&debugQuery=true
Not sure if the * gets translated somewhere into a null value parameter (I
am just starting to look at the solr code) per your comment
--
View this message in context: http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tp25789546p25878964.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: how can I use debugQuery if I have extended QParserPlugin?
Posted by Chris Hostetter <ho...@fucit.org>.
: My original post (
: http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tt25789546.html
: http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tt25789546.html
: ) has the stack trace. =^D
Actaully, no .. your orriginal post didn't include the stack trace. it
looks like you "edited" your post via Nabble after you sent it -- people
who subscribe to th mailinst list don't see edits in http->mail gateways
like nabble, if you have more info to add you should just reply to your
own message.
: I am having trouble reproducing this issue consistently (I sometimes dont
: get the NPE) so will have to track this down a bit more. Luckily, someone
It would help to know exactly which version of solr you are using, so that
people can correlate your stack trace line numbers with some source code
... i suspect that you are using something ~1.3, when writeFieldVal
constructed a new instance of a Field in order to Externalize it (that
code is no longer on the trunk, but i see a Field constructor in your
stack trace). that exception would orriginate when a Field is constructed
with a null "value" param, which would happen when writeFieldVal was
passed a null "val" ... the only way i can see that happening in code
arround the line numbers you posted is if you are constructing some type
of query (TermQuery, RangeQUery, etc...) where the Term object contains an
null value (ie: t.text() returns null) ... which is not a legal query.
-Hoss
Re: how can I use debugQuery if I have extended QParserPlugin?
Posted by gdeconto <ge...@topproducer.com>.
Hi Yonik;
My original post (
http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tt25789546.html
http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tt25789546.html
) has the stack trace. =^D
I am having trouble reproducing this issue consistently (I sometimes dont
get the NPE) so will have to track this down a bit more. Luckily, someone
just showed me how to debug the core solr files with Eclipse. Hopefully I
can now figure this out on my own.
thx
Yonik Seeley-2 wrote:
>
> I think you need to provide some more information such as a stack
> trace for the NPE, or a more elaborate description of what you think
> the problem is with the debug component.
> You said "because the debugging code looks at the query passed in and
> not the expanded query", but I don't understand that. The debug
> component is passed the actual Query object that the QParserPlugin
> created.
>
--
View this message in context: http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tp25789546p25812899.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: how can I use debugQuery if I have extended QParserPlugin?
Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Thu, Oct 8, 2009 at 12:14 PM, gdeconto
<ge...@topproducer.com> wrote:
> I did check the other posts, as well as whatever I could find on the net but
> didnt find anything.
>
> Has anyone encountered this type of issue, or is what I am doing (extending
> QParserPlugin) that unusual??
I think you need to provide some more information such as a stack
trace for the NPE, or a more elaborate description of what you think
the problem is with the debug component.
You said "because the debugging code looks at the query passed in and
not the expanded query", but I don't understand that. The debug
component is passed the actual Query object that the QParserPlugin
created.
-Yonik
http://www.lucidimagination.com
>
>
> gdeconto wrote:
>>
>> ...
>> one thing I noticed is that if I append "debugQuery=true" to a query that
>> includes the virtual function, I get a NullPointerException, likely
>> because the debugging code looks at the query passed in and not the
>> expanded query that my code generates and that gets used by solr for
>> retrieving data.
>> ...
>>
>
> --
> View this message in context: http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tp25789546p25803277.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Re: how can I use debugQuery if I have extended QParserPlugin?
Posted by gdeconto <ge...@topproducer.com>.
I did check the other posts, as well as whatever I could find on the net but
didnt find anything.
Has anyone encountered this type of issue, or is what I am doing (extending
QParserPlugin) that unusual??
gdeconto wrote:
>
> ...
> one thing I noticed is that if I append "debugQuery=true" to a query that
> includes the virtual function, I get a NullPointerException, likely
> because the debugging code looks at the query passed in and not the
> expanded query that my code generates and that gets used by solr for
> retrieving data.
> ...
>
--
View this message in context: http://www.nabble.com/how-can-I-use-debugQuery-if-I-have-extended-QParserPlugin--tp25789546p25803277.html
Sent from the Solr - User mailing list archive at Nabble.com.