Search code examples
solr

Why do I get different results changing the default operator when my search terms consist of a single word?


I've been testing different search queries in Solr 8, and I've found a peculiar case.

Using the Standard (Lucene) Query Parser, I search for the word "text". When I search using OR as the default operator, I get 5000+ results. However, using AND as the default operator (without changing anything else), I get 6 results.

If I repeat the same tests with Dismax as the query parser, the default operator does not seem to matter.

Is there a reason for this disparity, or is this a bug?


Solution

  • It wasn't clearly visible in Solr Admin, but it turns out that there was some extra text in the query string, which I had copy-pasted from a debug session of our application (that queries Solr).

    In short, nothing to see here, mea culpa.