lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Walter Underwood <>
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 21:49:36 GMT
I understand what you are asking for. Solr doesn’t work like that. Solr is not a programming
language Short-circuit evaluation isn’t especially useful for a search engine.

Most of the work is fetching and uncompressing the posting lists. Calculating the score for
each document is pretty fast.

Express your query in the Solr/Lucene query language and time it.

If field1:value1 is required and field2:value2 is optional, your query should be expressed
like this:

+field1:value1 field2:value2

Also, this is beginning to feel like an X-Y problem. What are you trying to achieve with this
evaluation requirement?

Walter Underwood  (my blog)

> On Feb 7, 2018, at 1:41 PM, bbarani <> wrote:
> Walter, It's just that I have a use case (to evaluate one field over other)
> for which I am trying out multiple solutions in order to avoid making
> multiple calls to SOLR. 
> I am trying to do a Short-circuit evaluation.
> Short-circuit evaluation, minimal evaluation, or McCarthy evaluation (after
> John McCarthy) is the semantics of some Boolean operators in some
> programming languages in which the second argument is executed or evaluated
> only if the first argument does not suffice to determine the value of the
> expression
> --
> Sent from:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message