lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emir Arnautović <emir.arnauto...@sematext.com>
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
Hi,
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.

HTH,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 7 Feb 2018, at 19:38, Walter Underwood <wunder@wunderwood.org> 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
lists.
> 
> So, that feature doesn’t exist because it isn’t useful.
> 
> wunder
> Walter Underwood
> wunder@wunderwood.org
> http://observer.wunderwood.org/  (my blog)
> 
>> On Feb 7, 2018, at 9:50 AM, bbarani <bbarani@gmail.com> 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: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
> 


Mime
View raw message