lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dodsworth (JIRA)" <>
Subject [jira] [Commented] (SOLR-2058) Adds optional "phrase slop" to edismax "pf2", "pf3" and "pf" parameters with field~slop^boost syntax
Date Tue, 25 Sep 2012 17:30:08 GMT


Michael Dodsworth commented on SOLR-2058:

It looks like this change also altered the way phrase queries are merged into the main query.

For the query: 'term1 term2' with pf2:[field1, field2, field3] we now get (omitting the non
phrase query section for clarity):
  <main query> DisjunctionMaxQuery((field1:"term1 term2"^1.0)~0.1)
DisjunctionMaxQuery((field2:"term1 term2"^1.0)~0.1)
DisjunctionMaxQuery((field3:"term1 term2"^1.0)~0.1)

Prior to this change, we got:

  <main query> DisjunctionMaxQuery((field1:"term1 term2"^1.0 | field2:"term1 term2"^1.0
| field3:"term1 term2"^1.0)~0.1)

The upshot being that if the phrase query "term1 term2" appears in multiple fields, it will
get a significant boost over the previous implementation. The presence of the dismax queries
makes me think this behavioral change was not intentional; if that's the case, let me know
and I'll get a fix together.
> Adds optional "phrase slop" to edismax "pf2", "pf3" and "pf" parameters with field~slop^boost
> ----------------------------------------------------------------------------------------------------
>                 Key: SOLR-2058
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>          Components: query parsers
>         Environment: n/a
>            Reporter: Ron Mayer
>            Assignee: James Dyer
>            Priority: Minor
>             Fix For: 4.0-ALPHA
>         Attachments: edismax_pf_with_slop_v2.1.patch, edismax_pf_with_slop_v2.patch,
pf2_with_slop.patch, SOLR-2058-and-3351-not-finished.patch, SOLR-2058.patch
> {quote}
> From	Ron Mayer <>
> ... my results might  be even better if I had a couple different "pf2"s with different
"ps"'s  at the same time.   In particular.   One with ps=0 to put a high boost on ones the
have  the right ordering of words.  For example insuring that [the query]:
>   "red hat black jacket"
>  boosts only documents with "red hats" and not "black hats".   And another pf2 with a
more modest boost with ps=5 or so to handle the query above also boosting docs with 
>   "red baseball hat".
> {quote}
> []
> {quote}
> From	Yonik Seeley <>
> Perhaps fold it into the pf/pf2 syntax?
> pf=text^2    // current syntax... makes phrases with a boost of 2
> pf=text~1^2  // proposed syntax... makes phrases with a slop of 1 and
> a boost of 2
> That actually seems pretty natural given the lucene query syntax - an
> actual boosted sloppy phrase query already looks like
> {{text:"foo bar"~1^2}}
> -Yonik
> {quote}
> []
> {quote}
> From	Chris Hostetter <>
> Big +1 to this idea ... the existing "ps" param can stick arround as the 
> default for any field that doesn't specify it's own slop in the pf/pf2/pf3 
> fields using the "~" syntax.
> -Hoss
> {quote}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message