public class WeightedSpanTermExtractor extends Object
WeightedSpanTerms 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 |
|---|---|
boolean |
getExpandMultiTermQuery() |
TokenStream |
getTokenStream() |
Map<String,WeightedSpanTerm> |
getWeightedSpanTerms(Query query,
TokenStream tokenStream)
Creates a Map of
WeightedSpanTerms from the given Query and TokenStream. |
Map<String,WeightedSpanTerm> |
getWeightedSpanTerms(Query query,
TokenStream tokenStream,
String fieldName)
Creates a Map of
WeightedSpanTerms from the given Query and TokenStream. |
Map<String,WeightedSpanTerm> |
getWeightedSpanTermsWithScores(Query query,
TokenStream tokenStream,
String fieldName,
IndexReader reader)
Creates a Map of
WeightedSpanTerms from the given Query and TokenStream. |
boolean |
isCachedTokenStream() |
void |
setExpandMultiTermQuery(boolean expandMultiTermQuery) |
void |
setWrapIfNotCachingTokenFilter(boolean wrap)
By default,
TokenStreams that are not of the type
CachingTokenFilter are wrapped in a CachingTokenFilter to
ensure an efficient reset - if you are already using a different caching
TokenStream impl and you don't want it to be wrapped, set this to
false. |
public WeightedSpanTermExtractor()
public WeightedSpanTermExtractor(String defaultField)
public Map<String,WeightedSpanTerm> getWeightedSpanTerms(Query query, TokenStream tokenStream) throws IOException
WeightedSpanTerms from the given Query and TokenStream.
query - that caused hittokenStream - of text to be highlightedIOException - If there is a low-level I/O errorpublic Map<String,WeightedSpanTerm> getWeightedSpanTerms(Query query, TokenStream tokenStream, 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 - If there is a low-level I/O errorpublic Map<String,WeightedSpanTerm> 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 - If there is a low-level I/O errorpublic boolean getExpandMultiTermQuery()
public void setExpandMultiTermQuery(boolean expandMultiTermQuery)
public boolean isCachedTokenStream()
public TokenStream getTokenStream()
public void setWrapIfNotCachingTokenFilter(boolean wrap)
TokenStreams that are not of the type
CachingTokenFilter are wrapped in a CachingTokenFilter to
ensure an efficient reset - if you are already using a different caching
TokenStream impl and you don't want it to be wrapped, set this to
false.Copyright © 2010 - 2020 Adobe. All Rights Reserved