public abstract class SpanWeight extends Weight
Modifier and Type | Class and Description |
---|---|
static class |
SpanWeight.Postings
Enumeration defining what postings information should be retrieved from the
index for a given Spans
|
Weight.DefaultBulkScorer
Modifier and Type | Field and Description |
---|---|
protected String |
field |
protected Similarity |
similarity |
protected Similarity.SimWeight |
simWeight |
parentQuery
Constructor and Description |
---|
SpanWeight(SpanQuery query,
IndexSearcher searcher,
Map<Term,TermContext> termContexts)
Create a new SpanWeight
|
Modifier and Type | Method and Description |
---|---|
Explanation |
explain(LeafReaderContext context,
int doc)
An explanation of the score computation for the named document.
|
abstract void |
extractTermContexts(Map<Term,TermContext> contexts)
Collect all TermContexts used by this Weight
|
Similarity.SimScorer |
getSimScorer(LeafReaderContext context)
Return a SimScorer for this context
|
abstract Spans |
getSpans(LeafReaderContext ctx,
SpanWeight.Postings requiredPostings)
Expert: Return a Spans object iterating over matches from this Weight
|
float |
getValueForNormalization()
The value for normalization of contained query clauses (e.g.
|
void |
normalize(float queryNorm,
float boost)
Assigns the query normalization factor and boost to this.
|
SpanScorer |
scorer(LeafReaderContext context)
Returns a
Scorer which can iterate in order over all matching
documents and assign them a score. |
bulkScorer, extractTerms, getQuery
protected final Similarity similarity
protected final Similarity.SimWeight simWeight
protected final String field
public SpanWeight(SpanQuery query, IndexSearcher searcher, Map<Term,TermContext> termContexts) throws IOException
query
- the parent querysearcher
- the IndexSearcher to query againsttermContexts
- a map of terms to termcontexts for use in building the similarity. May
be null if scores are not requiredIOException
- on errorpublic abstract void extractTermContexts(Map<Term,TermContext> contexts)
contexts
- a map to add the TermContexts topublic abstract Spans getSpans(LeafReaderContext ctx, SpanWeight.Postings requiredPostings) throws IOException
ctx
- a LeafReaderContext for this SpansIOException
- on errorpublic float getValueForNormalization() throws IOException
Weight
getValueForNormalization
in class Weight
IOException
public void normalize(float queryNorm, float boost)
Weight
public SpanScorer scorer(LeafReaderContext context) throws IOException
Weight
Scorer
which can iterate in order over all matching
documents and assign them a score.
NOTE: null can be returned if no documents will be scored by this query.
NOTE: The returned Scorer
does not have
LeafReader.getLiveDocs()
applied, they need to be checked on top.
scorer
in class Weight
context
- the LeafReaderContext
for which to return the Scorer
.Scorer
which scores documents in/out-of order.IOException
- if there is a low-level I/O errorpublic Similarity.SimScorer getSimScorer(LeafReaderContext context) throws IOException
context
- the LeafReaderContextIOException
- on errorpublic Explanation explain(LeafReaderContext context, int doc) throws IOException
Weight
explain
in class Weight
context
- the readers context to create the Explanation
for.doc
- the document's id relative to the given context's readerIOException
- if an IOException
occursCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.