On 6-Sep-07, at 12:55 PM, Yonik Seeley wrote:
On 9/5/07, Mike Klaas <[EMAIL PROTECTED]> wrote:
Issues:
- Solr still uses it's own FunctionQuery instead of what was added
back to Lucene. May want to migrate first, or may want to hold
off if
changes are needed that would be easier to make here.
I believe that the main thing missing is the various functions (which
should be subclasses of CustomScoreQuery).
I could see that for the top-level boost (except for the missing-
value problem).
Were you suggesting that other functions also derive from
CustomScoreQuery for some reason?
Well, the reason would be that CustomScoreQuery is a mechanism by
which custom score functions can be introduced, e.g.:
class RecipFloatScoreQuery extends CustomScoreQuery {
RecipFloatScore(Query source, float m, float a, float b) {
super(source)
...
}
public float customScore(int doc, float subQueryScore float
boostScore) {
// note: boostScore should never be set
return a/(m*subQueryScore + b)
}
}
Of course, it could be a ValueSource too, but the above formulation
allows the function to apply to any query. And binary ops are
trivial to add.
I haven't yet looked at SOLR-192 to see how it is done there, though.
-Mike