You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Doron Cohen (JIRA)" <ji...@apache.org> on 2007/05/03 05:10:17 UTC

[jira] Updated: (LUCENE-446) FunctionQuery - score based on field value

     [ https://issues.apache.org/jira/browse/LUCENE-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doron Cohen updated LUCENE-446:
-------------------------------

    Attachment: function.patch.txt

Attached function.patch.txt adds three new queries:

1. ValueSourceQuery -  an Expert type of query, more or less same as 
    in original patch. It is very flexible - takes a ValueSource as input - so it
    could be extended to do additional things (ie not only indexed fields).

2. FieldScoreQuery - subclass of ValueSourceQuery. It is easier
    to use, and operates on cached indexed field. A doc score is set 
    by the value of that field. There are 4 field parser types for this: float, int,
    short, and byte. They require different size in RAM when cached: 8, 4, 2, 
    and 1 bytes respectively per document. The cache was modified to 
    accommodate this. (Seems worth to save RAM where possible.)

3. CustomScoreQuery - this query allows to custom the score of its contained 
    sub-query by implementing a customScore() function. Any computation is 
    possible, as long as it is based on the original score of the sub-query, 
    the (optional) score of an (optional) sub-valueSourceQuery, and the docid.
    This query also covers (somewhat differently) LUCENE-850

The patch Included tests and javadocs. 
All tests pass.

I will later put the javadocs somewhere, to allow commenting on the API without 
applying the patch.

The tests found quite a few bugs for me, and I hope I got the scorers and weight 
correct now - I would very much appreciate review comments on these delicate
parts.,,

> FunctionQuery - score based on field value
> ------------------------------------------
>
>                 Key: LUCENE-446
>                 URL: https://issues.apache.org/jira/browse/LUCENE-446
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Search
>    Affects Versions: 1.9
>            Reporter: Yonik Seeley
>         Assigned To: Doron Cohen
>         Attachments: function.patch.txt, function.zip, function.zip
>
>
> FunctionQuery can return a score based on a field's value or on it's ordinal value.
> FunctionFactory subclasses define the details of the function.  There is currently a LinearFloatFunction (a line specified by slope and intercept).
> Field values are typically obtained from FieldValueSourceFactory.  Implementations include FloatFieldSource, IntFieldSource, and OrdFieldSource.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org