Class TermQuery

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class TermQuery
    extends org.apache.lucene.search.Query
    A Query that matches documents containing a term. This may be combined with other terms with a BooleanQuery.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      TermQuery​(org.apache.lucene.index.Term t)
      Constructs a query for the term t.
    • Constructor Detail

      • TermQuery

        public TermQuery​(org.apache.lucene.index.Term t)
        Constructs a query for the term t.
    • Method Detail

      • getTerm

        public org.apache.lucene.index.Term getTerm()
        Returns the term of this query.
      • createWeight

        protected org.apache.lucene.search.Weight createWeight​(org.apache.lucene.search.Searcher searcher)
                                                        throws IOException
        Overrides:
        createWeight in class org.apache.lucene.search.Query
        Throws:
        IOException
      • extractTerms

        public void extractTerms​(Set terms)
        Overrides:
        extractTerms in class org.apache.lucene.search.Query
      • toString

        public String toString​(String field)
        Prints a user-readable version of this query.
        Specified by:
        toString in class org.apache.lucene.search.Query
      • equals

        public boolean equals​(Object o)
        Returns true iff o is equal to this.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Returns a hash code value for this object.
        Overrides:
        hashCode in class Object