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 RAUNAK AGRAWAL <ag...@gmail.com> on 2018/05/23 23:40:24 UTC

Unable to make IN queries on a particular field in solr

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

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

Posted by Shawn Heisey <ap...@elyograg.org>.
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