OR query working on Leader Node only

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

OR query working on Leader Node only

tapan1707
I believe correct formats for OR search query are the following:
id:(id1 or id2)
id:id1 or id:id2

When I tried searching with "id:id1 or id2", it is parsing the query into
"id:id1 or _text_:id2" where _text_ is the field from solr's default config
set.
Also, for this, I need to add the _text_ field into my schema.xml otherwise
it returns an error saying

"error-class","org.apache.solr.common.SolrException",
      "root-error-class","org.apache.solr.common.SolrException"],
    "msg":"undefined field _text_",
    "code":400}}

I get it that query statement "id:id1 or id2" is incorrect and no wonder
solr is returning the up written error but what I didn't understand is why
isn't this happening for the Leader Node.
Irrespective of the search query, Leader Node is always parsing the query
correctly and this is not the case for some particular Leader node. At
first, Core_Node2 was returning the error but after some time leader
switched and Core_Node1 started returning the error while Core_Node2 parsing
the query correctly.

And by correctly I mean that "id:id1 or id2" is being parsed to "id:1 (id:or
id:2)".

I also found the similar issue on StackOverflow.(guess it's not just me)
https://stackoverflow.com/questions/41799251/solr-query-http-error-400-undefined-field-text

Can anyone explain me this parsing behaviour?
Thanks a lot in advance.



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: OR query working on Leader Node only

Shawn Heisey-2
On 8/9/2018 7:31 PM, tapan1707 wrote:
> I believe correct formats for OR search query are the following:
> id:(id1 or id2)
> id:id1 or id:id2

The correct form for an OR query is an uppercase "OR".  The lowercase
"or" won't do the same thing -- typically it will be interpreted as just
another search term.

When using the edismax query parser, there is a parameter
lowercaseOperators that (if set to true) will cause Solr to interpret
the lowercase version as an operator.  This *only* works with the
edismax query parser.  The default setting for lowercaseOperators was
true before 7.0, in 7.0 the default was changed to false.

I have no idea why one node would work differently than another.  That
sort of thing doesn't normally happen.

Thanks,
Shawn