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
AQuerythat 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 aSimilarityat 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 classBM25FQuery.BuilderA builder forBM25FQuery.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WeightcreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)booleanequals(Object other)List<Term>getTerms()inthashCode()longramBytesUsed()Queryrewrite(IndexReader reader)StringtoString(String field)voidvisit(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:
ramBytesUsedin interfaceAccountable
-
rewrite
public Query rewrite(IndexReader reader) throws IOException
- Overrides:
rewritein classQuery- Throws:
IOException
-
visit
public void visit(QueryVisitor visitor)
-
createWeight
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException
- Overrides:
createWeightin classQuery- Throws:
IOException
-
-