Package org.apache.lucene.search
Class BM25FQuery
- java.lang.Object
-
- org.apache.lucene.search.Query
-
- org.apache.lucene.search.BM25FQuery
-
- All Implemented Interfaces:
Accountable
public final class BM25FQuery extends Query implements Accountable
AQuery
that treats multiple fields as a single stream and scores terms as if you had indexed them as a single term in a single field. For scoring purposes this query implements the BM25F's simple formula described in: http://www.staff.city.ac.uk/~sb317/papers/foundations_bm25_review.pdf The per-field similarity is ignored but to be compatible each field must use aSimilarity
at index time that encodes norms the same way asSimilarityBase.computeNorm(org.apache.lucene.index.FieldInvertState)
.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BM25FQuery.Builder
A builder forBM25FQuery
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Weight
createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)
boolean
equals(Object other)
List<Term>
getTerms()
int
hashCode()
long
ramBytesUsed()
Query
rewrite(IndexReader reader)
String
toString(String field)
void
visit(QueryVisitor visitor)
-
Methods inherited from class org.apache.lucene.search.Query
classHash, sameClassAs, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
-
-
-
Method Detail
-
ramBytesUsed
public long ramBytesUsed()
- Specified by:
ramBytesUsed
in interfaceAccountable
-
rewrite
public Query rewrite(IndexReader reader) throws IOException
- Overrides:
rewrite
in classQuery
- Throws:
IOException
-
visit
public void visit(QueryVisitor visitor)
-
createWeight
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException
- Overrides:
createWeight
in classQuery
- Throws:
IOException
-
-