lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Mayer <>
Subject Re: edismax pf2 and ps
Date Thu, 19 Aug 2010 12:19:13 GMT
Chris Hostetter wrote:
> : 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
> 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.

I think I have a decent first draft of a patch that implements this.

Hopefully I'm figuring out the right way to submit patches to this community.
I added a ticket here:
and attached my patch to that ticket.   Any feedback, either on the patch
or on how best to submit things to this community would be appreciated.

This patch seems to happily turn a query like
into what I believe is the desired parsed query:

+((text:enterpris) (text:search) (text:foobar))
 ((name:"enterprise search"~5^12.0) (name:"search foobar"~5^12.0))
 ((name:"enterprise search"^5555.0) (name:"search foobar"^5555.0))
 ((name:"enterprise search"~10) (name:"search foobar"~10))

which looks like it should give a high boost to docs where both words
appear right next to each other, but still substantial boosts to docs
where the pairs of words are a few words apart.

I'll start testing it with real data today.

One question:

* Where might I find documentation and/or test cases for the pf2, pf3
  parameters? I quick grep of the sources from the tree I got from
  didn't reveal any obvious docs or tests with those parameters.
  $ git grep pf2 | grep -v 'Binary file'

Am I on the right track?


View raw message