org.apache.lucene.search
Class PhrasePrefixQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.PhrasePrefixQuery
- All Implemented Interfaces:
- Cloneable, Serializable
- public class PhrasePrefixQuery
- extends Query
PhrasePrefixQuery 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 has "app" as
prefix using IndexReader.terms(Term), and use PhrasePrefixQuery.add(Term[]
terms) to add them to the query.
- Version:
- 1.0
- Author:
- Anders Nielsen
- See Also:
- Serialized Form
PhrasePrefixQuery
public PhrasePrefixQuery()
setSlop
public void setSlop(int s)
getSlop
public int getSlop()
add
public void add(Term term)
add
public void add(Term[] terms)
createWeight
protected Weight createWeight(Searcher searcher)
- Description copied from class:
Query
- Expert: Constructs an appropriate Weight implementation for this query.
Only implemented by primitive queries, which re-write to themselves.
- Overrides:
createWeight
in class Query
toString
public final String toString(String f)
- Prints a user-readable version of this query.
- Specified by:
toString
in class Query
Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.