lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emir Arnautović <>
Subject Re: How to form a boolean query such that it wont evaluate the right hand side if it isn't necessary
Date Wed, 07 Feb 2018 20:05:11 GMT
Also note that score is different if only one term match and if both terms are matched. Your
case would make sense if you do not plan to order by score, but as Walter explained, Solr
does not go document by document and evaluate query conditions, but it gets list of documents
matching each part of boolean query (you can think of it as bitsets) and do union/intersection
to get the final result.

Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training -

> On 7 Feb 2018, at 19:38, Walter Underwood <> wrote:
> That doesn’t really make sense for Solr query evaluation. It fetches the posting lists
for each term, then walks through them evaluating the query against all the documents.
> It can skip a document as soon as it fails the query, but it still has to fetch the posting
> So, that feature doesn’t exist because it isn’t useful.
> wunder
> Walter Underwood
>  (my blog)
>> On Feb 7, 2018, at 9:50 AM, bbarani <> wrote:
>> I am trying to figure out a way to form boolean (||) query in SOLR.
>> Ideally my expectation is that with boolean operator ||, if first term is
>> true second term shouldn't be evaluated.
>> &q=searchTerms:"testing" || matchStemming:"stemming" 
>> works same as 
>> &q=searchTerms:"testing" OR matchStemming:"stemming" 
>> Is there a way to form a boolean query such that it wont evaluate the right
>> hand side if it isn't necessary?
>> --
>> Sent from:

View raw message