Your original formation of the filter query has two problems:

1> you included a “+” in the value. My guess is that you misinterpreted the 
     URL you got back from the browser in the admin UI where a “+” is a 
     URL-encoded space. You’ll also see a bunch of %XX in the URL which are
     other encodings.

2> you include double quotes, which can change things to be phrase queries.

Looking at the debug version would have helped you pinpoint these.


> On Mar 24, 2020, at 5:34 AM, Szűcs Roland <szucs.rol...@bookandwalk.hu> wrote:
> 
> Hi All,
> 
> I use Solr 8.4.1 and the latest solrj client.
> There is a field let's which can have 3 different values. If I use the
> admin UI, I write to the fq the following: filterName:"value1"
> filterName:"value2" and it is working as expected.
> If I use solrJ SolrQuery.addFilterQuery method and call it twice like:
> addFilterQuery(filterName+":\""+value1+"\"");
> addFilterQuery(filterName+":\""+value2+"\"");
> I got no any document back.
> 
> Can somebody help me what syntax is appropriate with solrj to add filter
> queries one by one if there is one filter field but multiple values?
> 
> Thanks,
> 
> Roland

Reply via email to