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 Indika Tantrigoda <in...@gmail.com> on 2012/10/30 15:16:37 UTC
SolrJ 4.0.0 addFilterQuery() issue ?
Hi All,
I am using Solr 4.0 and SolrJ 4.0.0 to access Solr from a Spring web
application, and I seem to have an issue when querying Solr. If the
SolrQuery contains more than one addFilterQuery() I get an exception
stating,
org.apache.solr.common.SolrException:
org.apache.lucene.queryparser.classic.ParseException: Cannot parse
'[Ljava.lang.String;@1ec278b5': Encountered "<EOF>" at line 1, column 28.
Was expecting one of:
"TO" ...
<RANGE_QUOTED> ...
<RANGE_GOOP> ...
I am using the addFilterQuery() in the following manner:
solrQuery.addFilterQuery("{!field f=facet_state}CA");
solrQuery.addFilterQuery("{!field f=facet_city}Test City");
The issue only comes up if there are more than one addFilterQuery() or if
multiple parameters are passed to setFilterQueries() or addFilterQuery() -
solrQuery.setFilterQueries("{!field f=facet_state}CA", "{!field
f=facet_city}Test City");
solrQuery.addFilterQuery("{!field f=facet_state}CA", "{!field
f=facet_city}Test City");
Is there a new/alternate way in SolrJ 4 that this is done ?
Thanks in advance.
Indika
Re: SolrJ 4.0.0 addFilterQuery() issue ?
Posted by Indika Tantrigoda <in...@gmail.com>.
Just created the defect in Jira.
https://issues.apache.org/jira/browse/SOLR-4020
Thanks.
On 31 October 2012 10:47, Indika Tantrigoda <in...@gmail.com> wrote:
> Thanks for the reply Chris.
>
> Yes you are correct, SolrJ is serializing a String[] instead of the
> separate String values.
>
> Using solrQuery.add("fq", "your first filter"); and solrQuery.add("fq",
> "your second filter"); has the same effect. Because it calls the add()
> method in the ModifiableSolrParams.java class. (Similar to
> solrQuery.setFilterQueries()).
>
> Yes, I will open a Jira issue for this with more information.
>
> Thanks,
> Indika
>
>
> On 31 October 2012 05:08, Chris Hostetter <ho...@fucit.org>wrote:
>
>>
>> : org.apache.solr.common.SolrException:
>> : org.apache.lucene.queryparser.classic.ParseException: Cannot parse
>> : '[Ljava.lang.String;@1ec278b5': Encountered "<EOF>" at line 1, column
>> 28.
>>
>> Hmmm.. that looks like a pretty anoying bug -- somehwere SolrJ is
>> serializing a String[] instead of sending the individual String values.
>>
>> can you please open a jira for this with these details?
>>
>> : Is there a new/alternate way in SolrJ 4 that this is done ?
>>
>> I would say that one possible workarround may be to
>> use...
>> solrQuery.add("fq", "your first filter");
>> solrQuery.add("fq", "your second filter");
>>
>> ...but i don't know where the bug is to know if that will actally work.
>> if you could try that also and mention the results in a comment in the
>> Jira you open that would be helpful.
>>
>> -Hoss
>>
>
>
Re: SolrJ 4.0.0 addFilterQuery() issue ?
Posted by Indika Tantrigoda <in...@gmail.com>.
Thanks for the reply Chris.
Yes you are correct, SolrJ is serializing a String[] instead of the
separate String values.
Using solrQuery.add("fq", "your first filter"); and solrQuery.add("fq",
"your second filter"); has the same effect. Because it calls the add()
method in the ModifiableSolrParams.java class. (Similar to
solrQuery.setFilterQueries()).
Yes, I will open a Jira issue for this with more information.
Thanks,
Indika
On 31 October 2012 05:08, Chris Hostetter <ho...@fucit.org> wrote:
>
> : org.apache.solr.common.SolrException:
> : org.apache.lucene.queryparser.classic.ParseException: Cannot parse
> : '[Ljava.lang.String;@1ec278b5': Encountered "<EOF>" at line 1, column
> 28.
>
> Hmmm.. that looks like a pretty anoying bug -- somehwere SolrJ is
> serializing a String[] instead of sending the individual String values.
>
> can you please open a jira for this with these details?
>
> : Is there a new/alternate way in SolrJ 4 that this is done ?
>
> I would say that one possible workarround may be to
> use...
> solrQuery.add("fq", "your first filter");
> solrQuery.add("fq", "your second filter");
>
> ...but i don't know where the bug is to know if that will actally work.
> if you could try that also and mention the results in a comment in the
> Jira you open that would be helpful.
>
> -Hoss
>
Re: SolrJ 4.0.0 addFilterQuery() issue ?
Posted by Chris Hostetter <ho...@fucit.org>.
: org.apache.solr.common.SolrException:
: org.apache.lucene.queryparser.classic.ParseException: Cannot parse
: '[Ljava.lang.String;@1ec278b5': Encountered "<EOF>" at line 1, column 28.
Hmmm.. that looks like a pretty anoying bug -- somehwere SolrJ is
serializing a String[] instead of sending the individual String values.
can you please open a jira for this with these details?
: Is there a new/alternate way in SolrJ 4 that this is done ?
I would say that one possible workarround may be to
use...
solrQuery.add("fq", "your first filter");
solrQuery.add("fq", "your second filter");
...but i don't know where the bug is to know if that will actally work.
if you could try that also and mention the results in a comment in the
Jira you open that would be helpful.
-Hoss