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 payalsharma <pa...@yahoo.com> on 2008/11/10 14:14:24 UTC

Getting Status 400 - org.apache.lucene.queryParser.ParseException on submitting a search query having ^ symbol through Web Application

Hi,

I am getting the following error while triggering a search query through the
web application :

HTTP Status 400 - org.apache.lucene.queryParser.ParseException: Cannot parse
'Sigma Survey for Police
Officers&field=Index_Type_s:productIndex&field=productType_s:product&field=Index_Type_s:productIndex&field=productType_s:program&field=Index_Type_s:productIndex&field=productType_s:course^1000&qt=dismaxrequest&hl=true':
Encountered ":" at line 1, column 84. Was expecting one of: <EOF> <AND> ...
<OR> ... <NOT> ... "+" ... "-" ... "(" ... "*" ... "^" ... <QUOTED> ...
<TERM> ... <FUZZY_SLOP> ... <PREFIXTERM> ... <WILDTERM> ... "[" ... "{" ...
<NUMBER> ... 


Search Query URL :
http://localhost:8080/apache-solr-1.3.0/core510000043/select/?
q=The Rough Guide to Film Musicals
1&field=Index_Type_s:productIndex&field=Index_Type_s:productIndex&field=productType_s:course^1000&qt=dismaxrequest&hl=true
(The same query returns proper result when hit on the Apache Solr server
directly)

In the application I m applying URLEncoding on the search string thus the
entire search string  gets converted into :

http://localhost:8080/apache-solr-1.3.0/core510000043/select/?
q=Sigma+Survey+for+Police+Officers%26field%3DIndex_Type_s%3AproductIndex%26field%3DproductType_s%3Aproduct%26field%3DIndex_Type_s%3AproductIndex%26field%3DproductType_s%3Aprogram%26field%3DIndex_Type_s%3AproductIndex%26field%3DproductType_s%3Acourse%5E1000%26qt%3Ddismaxrequest%26hl%3Dtrue

The error comes only when ^1000 gets appended into the search string , issue
persists even if even URLEncoding is applied.

Please provide suggestion for the same.

Regards,
Payal
-- 
View this message in context: http://www.nabble.com/Getting-Status-400---org.apache.lucene.queryParser.ParseException-on-submitting-a-search-query-having-%5E-symbol-through-Web-Application-tp20419668p20419668.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Getting Status 400 - org.apache.lucene.queryParser.ParseException on submitting a search query having ^ symbol through Web Application

Posted by Ryan McKinley <ry...@gmail.com>.
>
> In the application I m applying URLEncoding on the search string  
> thus the
> entire search string  gets converted into :
>
> http://localhost:8080/apache-solr-1.3.0/core510000043/select/?
> q=Sigma+Survey+for+Police+Officers%26field%3DIndex_Type_s 
> %3AproductIndex%26field%3DproductType_s%3Aproduct%26field 
> %3DIndex_Type_s%3AproductIndex%26field%3DproductType_s%3Aprogram 
> %26field%3DIndex_Type_s%3AproductIndex%26field%3DproductType_s 
> %3Acourse%5E1000%26qt%3Ddismaxrequest%26hl%3Dtrue
>

why are you URL encoding the & that seperates your parameters?

shouldn't this be:

?q=Sigma+Survey+for+Police+Officers&field=Index_Type_s&product...

Check that your parameters are getting parsed as expected, try adding  
&echoParams=explicit to your query and check the output:
http://localhost:8983/solr/select?q=*:*&echoParams=explicit

ryan