Unable to make IN queries on a particular field in solr

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to make IN queries on a particular field in solr

RAUNAK AGRAWAL
Hi,

I am facing an issue where I have a collection named employee collection.

Suppose I was to search employee by its id, so my query is *id:(1 2 3*) and
it is working fine in solr. Now let say I want to search by their name. So
my query is name:(Alice Bob).

Now the problem is when I am querying by *name:(Alice Bob)*, I am not
getting any result but if I query by *name:(Alice OR Bob)*, I am able to
fetch the result.

Can someone please explain:


   - Why IN query for name is not working with space and working with *OR*
   - *Why IN query for id is working with space and not working for name
   though both are fields in same collection.*


Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Unable to make IN queries on a particular field in solr

Shawn Heisey-2
On 5/23/2018 5:40 PM, RAUNAK AGRAWAL wrote:

> I am facing an issue where I have a collection named employee collection.
>
> Suppose I was to search employee by its id, so my query is *id:(1 2 3*) and
> it is working fine in solr. Now let say I want to search by their name. So
> my query is name:(Alice Bob).
>
> Now the problem is when I am querying by *name:(Alice Bob)*, I am not
> getting any result but if I query by *name:(Alice OR Bob)*, I am able to
> fetch the result.
>
> Can someone please explain:
>
>     - Why IN query for name is not working with space and working with *OR*
>     - *Why IN query for id is working with space and not working for name
>     though both are fields in same collection.*

Please add &debugQuery=true&rows=0&echoParams=all to the URL for both
versions of the name query (removing any existing rows parameter) and
send us the entirety of both responses.

These parameters are discussed here:

https://lucene.apache.org/solr/guide/7_3/common-query-parameters.html

What version of Solr are you running?

Thanks,
Shawn