org.apache.lucene.search.function |
|
Java Source File Name | Type | Comment |
ByteFieldSource.java | Class | Expert: obtains single byte field values from the
org.apache.lucene.search.FieldCache FieldCache using getBytes() and makes those values
available as other numeric types, casting as needed.
WARNING: The status of the search.function package is experimental. |
CustomScoreQuery.java | Class | Query that sets document score as a programmatic function of several (sub) scores.
- the score of its subQuery (any query)
- (optional) the score of its ValueSourtceQuery (or queries),
for most simple/convineient use case this query would be a
org.apache.lucene.search.function.FieldScoreQuery FieldScoreQuery
Subclasses can modify the computation by overriding
CustomScoreQuery.customScore(int,float,float) .
WARNING: The status of the search.function package is experimental. |
DocValues.java | Class | Expert: represents field values as different types.
Normally created via a
org.apache.lucene.search.function.ValueSource ValueSuorce
for a particular field and reader.
WARNING: The status of the search.function package is experimental. |
FieldCacheSource.java | Class | Expert: A base class for ValueSource implementations that retrieve values for
a single field from the
org.apache.lucene.search.FieldCache FieldCache .
Fields used herein nust be indexed (doesn't matter if these fields are stored or not).
It is assumed that each such indexed field is untokenized, or at least has a single token in a document.
For documents with multiple tokens of the same field, behavior is undefined (It is likely that current
code would use the value of one of these tokens, but this is not guaranteed).
Document with no tokens in this field are assigned the Zero value. |
FieldScoreQuery.java | Class | A query that scores each document as the value of the numeric input field.
The query matches all documents, and scores each document according to the numeric
value of that field. |
FloatFieldSource.java | Class | Expert: obtains float field values from the
org.apache.lucene.search.FieldCache FieldCache using getFloats() and makes those values
available as other numeric types, casting as needed.
WARNING: The status of the search.function package is experimental. |
FunctionTestSetup.java | Class | |
IntFieldSource.java | Class | Expert: obtains int field values from the
org.apache.lucene.search.FieldCache FieldCache using getInts() and makes those values
available as other numeric types, casting as needed.
WARNING: The status of the search.function package is experimental. |
OrdFieldSource.java | Class | Expert: obtains the ordinal of the field value from the default Lucene
org.apache.lucene.search.FieldCache Fieldcache using getStringIndex().
The native lucene index order is used to assign an ordinal value for each field value.
Example:
If there were only three field values: "apple","banana","pear"
then ord("apple")=1, ord("banana")=2, ord("pear")=3
WARNING:
ord() depends on the position in an index and can thus change
when other documents are inserted or deleted,
or if a MultiSearcher is used. |
ReverseOrdFieldSource.java | Class | Expert: obtains the ordinal of the field value from the default Lucene
org.apache.lucene.search.FieldCache FieldCache using getStringIndex()
and reverses the order.
The native lucene index order is used to assign an ordinal value for each field value.
Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1.
Example of reverse ordinal (rord):
If there were only three field values: "apple","banana","pear"
then rord("apple")=3, rord("banana")=2, ord("pear")=1
WARNING:
rord() depends on the position in an index and can thus change
when other documents are inserted or deleted,
or if a MultiSearcher is used. |
ShortFieldSource.java | Class | Expert: obtains short field values from the
org.apache.lucene.search.FieldCache FieldCache using getShorts() and makes those values
available as other numeric types, casting as needed.
WARNING: The status of the search.function package is experimental. |
TestCustomScoreQuery.java | Class | Test CustomScoreQuery search. |
TestFieldScoreQuery.java | Class | Test FieldScoreQuery search.
Tests here create an index with a few documents, each having
an int value indexed field and a float value indexed field.
The values of these fields are later used for scoring.
The rank tests use Hits to verify that docs are ordered (by score) as expected.
The exact score tests use TopDocs top to verify the exact score. |
TestOrdValues.java | Class | Test search based on OrdFieldSource and ReverseOrdFieldSource.
Tests here create an index with a few documents, each having
an indexed "id" field.
The ord values of this field are later used for scoring.
The order tests use Hits to verify that docs are ordered as expected.
The exact score tests use TopDocs top to verify the exact score. |
ValueSource.java | Class | Expert: source of values for basic function queries.
At its default/simplest form, values - one per doc - are used as the score of that doc.
Values are instantiated as
org.apache.lucene.search.function.DocValues DocValues for a particular reader.
ValueSource implementations differ in RAM requirements: it would always be a factor
of the number of documents, but for each document the number of bytes can be 1, 2, 4, or 8. |
ValueSourceQuery.java | Class | Expert: A Query that sets the scores of document to the
values obtained from a
org.apache.lucene.search.function.ValueSource ValueSource .
The value source can be based on a (cached) value of an indexd field, but it
can also be based on an external source, e.g. |