Class FieldQuery
java.lang.Object
org.apache.lucene.search.vectorhighlight.FieldQuery
FieldQuery breaks down query object into terms/phrases and keeps them in a QueryPhraseMap
structure.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInternal structure of a query for highlighting: represents a nested query structure -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final booleanprivate static final int(package private) Map<String, FieldQuery.QueryPhraseMap> (package private) int -
Constructor Summary
ConstructorsConstructorDescriptionFieldQuery(Query query, boolean phraseHighlight, boolean fieldMatch) For backwards compatibility you can initialize FieldQuery without an IndexReader, which is only required to support MultiTermQueryFieldQuery(Query query, IndexReader reader, boolean phraseHighlight, boolean fieldMatch) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckOverlap(Collection<Query> expandQueries, Term[] src, Term[] dest, int slop, float boost) private voidcheckOverlap(Collection<Query> expandQueries, PhraseQuery a, float aBoost, PhraseQuery b, float bBoost) (package private) Collection<Query> expand(Collection<Query> flatQueries) protected voidflatten(Query sourceQuery, IndexSearcher searcher, Collection<Query> flatQueries, float boost) getFieldTermMap(String fieldName, String term) private Stringprivate FieldQuery.QueryPhraseMapgetRootMap(String fieldName) (package private) FieldQuery.QueryPhraseMapgetRootMap(Query query) getTermSet(String field) getTermSet(Query query) (package private) int(package private) voidsaveTerms(Collection<Query> flatQueries, IndexSearcher searcher) searchPhrase(String fieldName, List<FieldTermStack.TermInfo> phraseCandidate)
-
Field Details
-
fieldMatch
final boolean fieldMatch -
rootMaps
Map<String,FieldQuery.QueryPhraseMap> rootMaps -
termSetMap
-
termOrPhraseNumber
int termOrPhraseNumber -
MAX_MTQ_TERMS
private static final int MAX_MTQ_TERMS- See Also:
-
-
Constructor Details
-
FieldQuery
public FieldQuery(Query query, IndexReader reader, boolean phraseHighlight, boolean fieldMatch) throws IOException - Throws:
IOException
-
FieldQuery
FieldQuery(Query query, boolean phraseHighlight, boolean fieldMatch) throws IOException For backwards compatibility you can initialize FieldQuery without an IndexReader, which is only required to support MultiTermQuery- Throws:
IOException
-
-
Method Details
-
flatten
protected void flatten(Query sourceQuery, IndexSearcher searcher, Collection<Query> flatQueries, float boost) throws IOException - Throws:
IOException
-
expand
-
checkOverlap
private void checkOverlap(Collection<Query> expandQueries, PhraseQuery a, float aBoost, PhraseQuery b, float bBoost) -
checkOverlap
private void checkOverlap(Collection<Query> expandQueries, Term[] src, Term[] dest, int slop, float boost) -
getRootMap
-
getKey
-
saveTerms
- Throws:
IOException
-
getTermSet
-
getTermSet
-
getFieldTermMap
- Returns:
- QueryPhraseMap
-
searchPhrase
public FieldQuery.QueryPhraseMap searchPhrase(String fieldName, List<FieldTermStack.TermInfo> phraseCandidate) - Returns:
- QueryPhraseMap
-
getRootMap
-
nextTermOrPhraseNumber
int nextTermOrPhraseNumber()
-