lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Mayer <r...@0ape.com>
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: https://issues.apache.org/jira/browse/SOLR-2058
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
  http://localhost:8983/solr/select?defType=edismax&fl=id,text,score&q=enterprise+search+foobar&ps=5&qf=text&debugQuery=true&pf2=name~0^5555&pf2=name^12+name~10
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
  git://git.apache.org/lucene-solr.git
  didn't reveal any obvious docs or tests with those parameters.
  $ git grep pf2 | grep -v 'Binary file'
  solr/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java:
       U.parseFieldBoostsAndSlop(solrParams.getParams("pf2"));


Am I on the right track?


   Ron

Mime
View raw message