tamaramata / solrnet

Automatically exported from code.google.com/p/solrnet
0 stars 0 forks source link

Brackets around q parameter causes error #167

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using SolrNet 0.3.1 (and tried 0.4.1001), but i have a problem with the 
request to Tomcat/Solr

This is an example querystring that SolrNet sends to Tomcat:
facet=true&q=({!tag%3DCC}CountryCode:CR)&facet.date=StartDate&f.StartDate.facet.
date.end=2012-10-01T00:00:00Z&facet.field={!ex%3DCC}CountryCode&f.StartDate.face
t.date.start=2011-10-01T00:00:00Z&rows=0&version=2.2&f.StartDate.facet.date.gap=
%2B1MONTH

The final request in my case looks like: 
http://localhost:8080/solr/select/?facet=true&q=({!tag%3DCC}CountryCode:CR)&face
t.date=StartDate&f.StartDate.facet.date.end=2012-10-01T00:00:00Z&facet.field={!e
x%3DCC}CountryCode&f.StartDate.facet.date.start=2011-10-01T00:00:00Z&rows=0&vers
ion=2.2&f.StartDate.facet.date.gap=%2B1MONTH

On this request, Tomcat is sending this error: HTTP Status 400 - 
org.apache.lucene.queryParser.ParseException: Cannot parse 
'({!tag=CC}CountryCode:CR)': Encountered " "}" "} "" at line 1, column 9. Was 
expecting one of: "TO" ... <RANGEEX_QUOTED> ... <RANGEEX_GOOP> ...

After long research, i found out, i had to remove the brackets  "(" and ")" 
around the q parameter
So, if i post this, i'll have my correct results without an error:
http://localhost:8080/solr/select/?facet=true&q={!tag%3DCC}CountryCode:CR&facet.
date=StartDate&f.StartDate.facet.date.end=2012-10-01T00:00:00Z&facet.field={!ex%
3DCC}CountryCode&f.StartDate.facet.date.start=2011-10-01T00:00:00Z&rows=0&versio
n=2.2&f.StartDate.facet.date.gap=%2B1MONTH

This is the C# code

Original issue reported on code.google.com by ruben.ge...@gmail.com on 26 Oct 2011 at 2:30

Attachments:

GoogleCodeExporter commented 8 years ago
Just tested this, can't seem to repro: 
https://github.com/mausch/SolrNet/commit/8dcf8b6cedb09cadc00efe0516a09f1b7b7ccbf
f

Please try the latest binaries from the build server (see Artifacts in 
http://teamcity.codebetter.com/viewType.html?buildTypeId=bt290&tab=buildTypeStat
usDiv&guest=1 )

Original comment by mauricio...@gmail.com on 26 Oct 2011 at 10:38

GoogleCodeExporter commented 8 years ago
Are you still there?

Original comment by mauricio...@gmail.com on 4 Nov 2011 at 9:24

GoogleCodeExporter commented 8 years ago
Please let me know if you're still there. Otherwise, since it works on master, 
I'll close this issue.

Original comment by mauricio...@gmail.com on 30 Nov 2011 at 1:23

GoogleCodeExporter commented 8 years ago

Original comment by mauricio...@gmail.com on 23 Jan 2012 at 1:44