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? wunder Walter Underwood wun...@wunderwood.org http://observer.wunderwood.org/ (my blog) > On Feb 7, 2018, at 1:41 PM, bbarani <bbar...@gmail.com> 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: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html