|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lucene.search.highlight.WeightedSpanTermExtractor
public class WeightedSpanTermExtractor
Class used to extract WeightedSpanTerms from a Query based on whether
Terms from the Query are contained in a supplied TokenStream.
| Nested Class Summary | |
|---|---|
protected static class |
WeightedSpanTermExtractor.PositionCheckingMap<K>
This class makes sure that if both position sensitive and insensitive versions of the same term are added, the position insensitive one wins. |
| Constructor Summary | |
|---|---|
WeightedSpanTermExtractor()
|
|
WeightedSpanTermExtractor(String defaultField)
|
|
| Method Summary | |
|---|---|
protected void |
collectSpanQueryFields(org.apache.lucene.search.spans.SpanQuery spanQuery,
Set<String> fieldNames)
|
protected void |
extract(org.apache.lucene.search.Query query,
Map<String,WeightedSpanTerm> terms)
Fills a Map with <@link WeightedSpanTerm>s using the terms from the supplied Query. |
protected void |
extractUnknownQuery(org.apache.lucene.search.Query query,
Map<String,WeightedSpanTerm> terms)
|
protected void |
extractWeightedSpanTerms(Map<String,WeightedSpanTerm> terms,
org.apache.lucene.search.spans.SpanQuery spanQuery)
Fills a Map with <@link WeightedSpanTerm>s using the terms from the supplied SpanQuery. |
protected void |
extractWeightedTerms(Map<String,WeightedSpanTerm> terms,
org.apache.lucene.search.Query query)
Fills a Map with <@link WeightedSpanTerm>s using the terms from the supplied Query. |
protected boolean |
fieldNameComparator(String fieldNameToCheck)
Necessary to implement matches for queries against defaultField |
boolean |
getExpandMultiTermQuery()
|
protected org.apache.lucene.index.IndexReader |
getReaderForField(String field)
|
org.apache.lucene.analysis.TokenStream |
getTokenStream()
|
Map<String,WeightedSpanTerm> |
getWeightedSpanTerms(org.apache.lucene.search.Query query,
org.apache.lucene.analysis.TokenStream tokenStream)
Creates a Map of WeightedSpanTerms from the given Query and TokenStream. |
Map<String,WeightedSpanTerm> |
getWeightedSpanTerms(org.apache.lucene.search.Query query,
org.apache.lucene.analysis.TokenStream tokenStream,
String fieldName)
Creates a Map of WeightedSpanTerms from the given Query and TokenStream. |
Map<String,WeightedSpanTerm> |
getWeightedSpanTermsWithScores(org.apache.lucene.search.Query query,
org.apache.lucene.analysis.TokenStream tokenStream,
String fieldName,
org.apache.lucene.index.IndexReader reader)
Creates a Map of WeightedSpanTerms from the given Query and TokenStream. |
boolean |
isCachedTokenStream()
|
protected boolean |
mustRewriteQuery(org.apache.lucene.search.spans.SpanQuery spanQuery)
|
void |
setExpandMultiTermQuery(boolean expandMultiTermQuery)
|
protected void |
setMaxDocCharsToAnalyze(int maxDocCharsToAnalyze)
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WeightedSpanTermExtractor()
public WeightedSpanTermExtractor(String defaultField)
| Method Detail |
|---|
protected void extract(org.apache.lucene.search.Query query,
Map<String,WeightedSpanTerm> terms)
throws IOException
Map with <@link WeightedSpanTerm>s using the terms from the supplied Query.
query - Query to extract Terms fromterms - Map to place created WeightedSpanTerms in
IOException
protected void extractUnknownQuery(org.apache.lucene.search.Query query,
Map<String,WeightedSpanTerm> terms)
throws IOException
IOException
protected void extractWeightedSpanTerms(Map<String,WeightedSpanTerm> terms,
org.apache.lucene.search.spans.SpanQuery spanQuery)
throws IOException
Map with <@link WeightedSpanTerm>s using the terms from the supplied SpanQuery.
terms - Map to place created WeightedSpanTerms inspanQuery - SpanQuery to extract Terms from
IOException
protected void extractWeightedTerms(Map<String,WeightedSpanTerm> terms,
org.apache.lucene.search.Query query)
throws IOException
Map with <@link WeightedSpanTerm>s using the terms from the supplied Query.
terms - Map to place created WeightedSpanTerms inquery - Query to extract Terms from
IOExceptionprotected boolean fieldNameComparator(String fieldNameToCheck)
defaultField
protected org.apache.lucene.index.IndexReader getReaderForField(String field)
throws IOException
IOException
public Map<String,WeightedSpanTerm> getWeightedSpanTerms(org.apache.lucene.search.Query query,
org.apache.lucene.analysis.TokenStream tokenStream)
throws IOException
WeightedSpanTerms from the given Query and TokenStream.
query - that caused hittokenStream - of text to be highlighted
IOException
public Map<String,WeightedSpanTerm> getWeightedSpanTerms(org.apache.lucene.search.Query query,
org.apache.lucene.analysis.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 name
IOException
public Map<String,WeightedSpanTerm> getWeightedSpanTermsWithScores(org.apache.lucene.search.Query query,
org.apache.lucene.analysis.TokenStream tokenStream,
String fieldName,
org.apache.lucene.index.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 scoring
IOException
protected void collectSpanQueryFields(org.apache.lucene.search.spans.SpanQuery spanQuery,
Set<String> fieldNames)
protected boolean mustRewriteQuery(org.apache.lucene.search.spans.SpanQuery spanQuery)
public boolean getExpandMultiTermQuery()
public void setExpandMultiTermQuery(boolean expandMultiTermQuery)
public boolean isCachedTokenStream()
public org.apache.lucene.analysis.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.
wrap - protected final void setMaxDocCharsToAnalyze(int maxDocCharsToAnalyze)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||