java.lang.Object | ||
↳ | org.apache.lucene.search.Query | |
↳ | org.apache.lucene.search.MultiPhraseQuery |
MultiPhraseQuery is a generalized version of PhraseQuery, with an added
method add(Term[])
.
To use this class, to search for the phrase "Microsoft app*" first use
add(Term) on the term "Microsoft", then find all terms that have "app" as
prefix using IndexReader.terms(Term), and use MultiPhraseQuery.add(Term[]
terms) to add them to the query.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add a single term at the next position in the phrase.
| |||||||||||
Allows to specify the relative position of terms within the phrase.
| |||||||||||
Add multiple terms at the next position in the phrase.
| |||||||||||
Expert: Constructs an appropriate Weight implementation for this query.
| |||||||||||
Returns true if
o is equal to this. | |||||||||||
Expert: adds all terms occurring in this query to the terms set.
| |||||||||||
Returns the relative positions of terms in this phrase.
| |||||||||||
Sets the phrase slop for this query.
| |||||||||||
Returns a List of the terms in the multiphrase.
| |||||||||||
Returns a hash code value for this object.
| |||||||||||
Expert: called to re-write queries into primitive queries.
| |||||||||||
Sets the phrase slop for this query.
| |||||||||||
Prints a user-readable version of this query.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.lucene.search.Query
| |||||||||||
From class
java.lang.Object
|
Allows to specify the relative position of terms within the phrase.
Add multiple terms at the next position in the phrase. Any of the terms may match.
Expert: Constructs an appropriate Weight implementation for this query.
Only implemented by primitive queries, which re-write to themselves.
IOException |
---|
Expert: adds all terms occurring in this query to the terms set. Only
works if this query is in its rewritten
form.
Returns the relative positions of terms in this phrase.
Returns a List of the terms in the multiphrase. Do not modify the List or its contents.
Returns a hash code value for this object.
Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.