Hi Andrea,

Yes, on further investigation I found -
https://github.com/apache/lucene-solr/blob/e2521b2a8baabdaf43b92192588f51e042d21e97/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java#L574

I also created a ticket to resolve these differences and have a uniform way
of handling query parsing between dismax and edismax, but it was closed
since it required further discussion on whether this was intended or not.

I personally found adding phrasal boosts to single token queries very
non-intuitive and IMO dismax parser should be updated to apply phrasal
boosts to multi-token queries.

You can find further details about the problem here -
https://issues.apache.org/jira/browse/SOLR-12409

Regards,
Sam

On Mon, May 28, 2018 at 12:31 PM, Andrea Gazzarini <a.gazzar...@sease.io>
wrote:

> 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