Hi Sam,
I noticed the same behaviour. Looking at the code it seems that it is expected: the two classes (ExtendedDisMaxQParser and DisMaxQParser) don't have a direct inheritance relationships and the methods which deal with the PF parameter are different. Specifically, the DismaxQParser.getPhraseQuery seems to produce the query phrase regardless the number of terms that compose the query (and this matches with the observed behaviour), while the ExtendedDismax seems to take in account this aspect .

I agree with you, it results in a different behaviour, even for those single-word queries that output more than one terms (e.g. putting a pf clause with a q=hello-world and a field in qf which uses a StandardTokenizer or a WordDelimiterFilter in the analyzer).

About the reason of such different implementation, I don't know, maybe someone else here is able to help you.

Best,
Andrea

On 27/05/18 15:14, Sambhav Kothari wrote:
Hello,

I experienced a weird behaviour with dismax and edismax query parsers.
Dismax will include pf boosts when we query something that has just a
single word, edismax on the other hand will not include pf boosts.

The result is that a dismax and an edismax handler with the same set of
defaults, return different results for single word queries (eg. "Hello")
but the same results for multi word queries (eg. "Hello Wold")

Is this expected?

Regards,
Sam


Reply via email to