org.apache.lucene.search
Class PhrasePrefixQuery

java.lang.Object
  extended byorg.apache.lucene.search.Query
      extended byorg.apache.lucene.search.PhrasePrefixQuery
All Implemented Interfaces:
Cloneable, Serializable

Deprecated. use MultiPhraseQuery instead

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

Constructor Summary
PhrasePrefixQuery()
          Deprecated.  
 
Method Summary
 void add(Term term)
          Deprecated. Add a single term at the next position in the phrase.
 void add(Term[] terms)
          Deprecated. Add multiple terms at the next position in the phrase.
 void add(Term[] terms, int position)
          Deprecated. Allows to specify the relative position of terms within the phrase.
protected  Weight createWeight(Searcher searcher)
          Deprecated. Expert: Constructs an appropriate Weight implementation for this query.
 int[] getPositions()
          Deprecated. Returns the relative positions of terms in this phrase.
 int getSlop()
          Deprecated. Sets the phrase slop for this query.
 void setSlop(int s)
          Deprecated. Sets the phrase slop for this query.
 String toString(String f)
          Deprecated. Prints a user-readable version of this query.
 
Methods inherited from class org.apache.lucene.search.Query
clone, combine, extractTerms, getBoost, getSimilarity, mergeBooleanQueries, rewrite, setBoost, toString, weight
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PhrasePrefixQuery

public PhrasePrefixQuery()
Deprecated. 
Method Detail

setSlop

public void setSlop(int s)
Deprecated. 
Sets the phrase slop for this query.

See Also:
PhraseQuery.setSlop(int)

getSlop

public int getSlop()
Deprecated. 
Sets the phrase slop for this query.

See Also:
PhraseQuery.getSlop()

add

public void add(Term term)
Deprecated. 
Add a single term at the next position in the phrase.

See Also:
PhraseQuery.add(Term)

add

public void add(Term[] terms)
Deprecated. 
Add multiple terms at the next position in the phrase. Any of the terms may match.

See Also:
PhraseQuery.add(Term)

add

public void add(Term[] terms,
                int position)
Deprecated. 
Allows to specify the relative position of terms within the phrase.

Parameters:
terms -
position -
See Also:
PhraseQuery.add(Term, int)

getPositions

public int[] getPositions()
Deprecated. 
Returns the relative positions of terms in this phrase.


createWeight

protected Weight createWeight(Searcher searcher)
                       throws IOException
Deprecated. 
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
Throws:
IOException

toString

public final String toString(String f)
Deprecated. 
Prints a user-readable version of this query.

Specified by:
toString in class Query


Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.