public class WeightedSpanTermExtractor extends Object
WeightedSpanTerm
s from a Query
based on whether Terms from the query are contained in a supplied TokenStream.Constructor and Description |
---|
WeightedSpanTermExtractor() |
WeightedSpanTermExtractor(String defaultField) |
Modifier and Type | Method and Description |
---|---|
Map |
getWeightedSpanTerms(Query query,
CachingTokenFilter cachingTokenFilter)
Creates a Map of
WeightedSpanTerms from the given Query and TokenStream . |
Map |
getWeightedSpanTerms(Query query,
CachingTokenFilter cachingTokenFilter,
String fieldName)
Creates a Map of
WeightedSpanTerms from the given Query and TokenStream . |
Map |
getWeightedSpanTermsWithScores(Query query,
TokenStream tokenStream,
String fieldName,
IndexReader reader)
Creates a Map of
WeightedSpanTerms from the given Query and TokenStream . |
boolean |
isHighlightCnstScrRngQuery() |
void |
setHighlightCnstScrRngQuery(boolean highlightCnstScrRngQuery) |
public WeightedSpanTermExtractor()
public WeightedSpanTermExtractor(String defaultField)
public Map getWeightedSpanTerms(Query query, CachingTokenFilter cachingTokenFilter) throws IOException
WeightedSpanTerms
from the given Query
and TokenStream
.
query
- that caused hittokenStream
- of text to be highlightedIOException
public Map getWeightedSpanTerms(Query query, CachingTokenFilter cachingTokenFilter, String fieldName) throws IOException
WeightedSpanTerms
from the given Query
and TokenStream
.
query
- that caused hittokenStream
- of text to be highlightedfieldName
- restricts Term's used based on field nameIOException
public Map getWeightedSpanTermsWithScores(Query query, TokenStream tokenStream, String fieldName, IndexReader reader) throws IOException
WeightedSpanTerms
from the given Query
and TokenStream
. Uses a supplied
IndexReader
to properly weight terms (for gradient highlighting).
query
- that caused hittokenStream
- of text to be highlightedfieldName
- restricts Term's used based on field namereader
- to use for scoringIOException
public boolean isHighlightCnstScrRngQuery()
public void setHighlightCnstScrRngQuery(boolean highlightCnstScrRngQuery)
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.