# Uses of Class
org.apache.lucene.index.Term

Packages that use Term
Package
Description
org.apache.lucene.index
Code to maintain and access indices.
org.apache.lucene.search
Code to search indices.
org.apache.lucene.util
Some utility classes.
org.apache.lucene.util.graph
Utility classes for working with token streams as graphs.

## Uses of Term in org.apache.lucene.index

Methods in org.apache.lucene.index with parameters of type Term
Modifier and Type
Method
Description
`void`
PrefixCodedTerms.Builder.`add(Term term)`
add a term
`static TermStates`
TermStates.`build(IndexSearcher indexSearcher, Term term, boolean needsStats)`
Creates a `TermStates` from a top-level `IndexReaderContext` and the given `Term`.
`int`
Term.`compareTo(Term other)`
Compares two terms, returning a negative integer if this term belongs before the argument, zero if this term is equal to the argument, and a positive integer if this term belongs after the argument.
`long`
IndexWriter.`deleteDocuments(Term... terms)`
Deletes the document(s) containing any of the terms.
`final int`
BaseCompositeReader.`docFreq(Term term)`
`abstract int`
IndexReader.`docFreq(Term term)`
Returns the number of documents containing the `term`.
`final int`
LeafReader.`docFreq(Term term)`
`final PostingsEnum`
LeafReader.`postings(Term term)`
Returns `PostingsEnum` for the specified term with `PostingsEnum.FREQS`.
`final PostingsEnum`
LeafReader.`postings(Term term, int flags)`
Returns `PostingsEnum` for the specified term.
`long`
IndexWriter.`softUpdateDocument(Term term, Iterable<? extends IndexableField> doc, Field... softDeletes)`
Expert: Updates a document by first updating the document(s) containing `term` with the given doc-values fields and then adding the new document.
`long`
IndexWriter.`softUpdateDocuments(Term term, Iterable<? extends Iterable<? extends IndexableField>> docs, Field... softDeletes)`
Expert: Atomically updates documents matching the provided term with the given doc-values fields and adds a block of documents with sequentially assigned document IDs, such that an external reader will see all or none of the documents.
`final long`
BaseCompositeReader.`totalTermFreq(Term term)`
`abstract long`
IndexReader.`totalTermFreq(Term term)`
Returns the total number of occurrences of `term` across all documents (the sum of the freq() for each doc that has this term).
`final long`
LeafReader.`totalTermFreq(Term term)`
Returns the number of documents containing the term `t`.
`long`
IndexWriter.`updateBinaryDocValue(Term term, String field, BytesRef value)`
Updates a document's `BinaryDocValues` for `field` to the given `value` .
`long`
IndexWriter.`updateDocument(Term term, Iterable<? extends IndexableField> doc)`
Updates a document by first deleting the document(s) containing `term` and then adding the new document.
`long`
IndexWriter.`updateDocuments(Term delTerm, Iterable<? extends Iterable<? extends IndexableField>> docs)`
Atomically deletes documents matching the provided delTerm and adds a block of documents with sequentially assigned document IDs, such that an external reader will see all or none of the documents.
`long`
IndexWriter.`updateDocValues(Term term, Field... updates)`
Updates documents' DocValues fields to the given values.
`long`
IndexWriter.`updateNumericDocValue(Term term, String field, long value)`
Updates a document's `NumericDocValues` for `field` to the given `value` .

## Uses of Term in org.apache.lucene.search

Fields in org.apache.lucene.search declared as Term
Modifier and Type
Field
Description
`protected final Term`
AutomatonQuery.`term`
term containing the field, and possibly some pattern structure
Methods in org.apache.lucene.search that return Term
Modifier and Type
Method
Description
`Term`
PrefixQuery.`getPrefix()`
Returns the prefix of this query.
`Term`
RegexpQuery.`getRegexp()`
Returns the regexp of this query wrapped in a Term.
`Term`
FuzzyQuery.`getTerm()`
Returns the pattern term.
`Term`
TermQuery.`getTerm()`
Returns the term of this query.
`Term`
WildcardQuery.`getTerm()`
Returns the pattern term.
`Term[][]`
MultiPhraseQuery.`getTermArrays()`
Returns the arrays of arrays of terms in the multi-phrase.
`Term[]`
NGramPhraseQuery.`getTerms()`
Return the list of terms.
`Term[]`
PhraseQuery.`getTerms()`
Returns the list of terms in this phrase.
Methods in org.apache.lucene.search that return types with arguments of type Term
Modifier and Type
Method
Description
`List<Term>`
SynonymQuery.`getTerms()`
Returns the terms of this `SynonymQuery`
Methods in org.apache.lucene.search with parameters of type Term
Modifier and Type
Method
Description
`BlendedTermQuery.Builder`
BlendedTermQuery.Builder.`add(Term term)`
Add a new `Term` to this builder, with a default boost of `1`.
`BlendedTermQuery.Builder`
BlendedTermQuery.Builder.`add(Term term, float boost)`
Add a `Term` with the provided boost.
`BlendedTermQuery.Builder`
BlendedTermQuery.Builder.`add(Term term, float boost, TermStates context)`
Expert: Add a `Term` with the provided boost and context.
`MultiPhraseQuery.Builder`
MultiPhraseQuery.Builder.`add(Term term)`
Add a single term at the next position in the phrase.
`MultiPhraseQuery.Builder`
MultiPhraseQuery.Builder.`add(Term[] terms)`
Add multiple terms at the next position in the phrase.
`MultiPhraseQuery.Builder`
MultiPhraseQuery.Builder.`add(Term[] terms, int position)`
Allows to specify the relative position of terms within the phrase.
`PhraseQuery.Builder`
PhraseQuery.Builder.`add(Term term)`
Adds a term to the end of the query phrase.
`PhraseQuery.Builder`
PhraseQuery.Builder.`add(Term term, int position)`
Adds a term to the end of the query phrase.
`protected void`
MultiTermQuery.TopTermsBlendedFreqScoringRewrite.`addClause(BlendedTermQuery.Builder topLevel, Term term, int docCount, float boost, TermStates states)`
`protected void`
MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite.`addClause(BooleanQuery.Builder topLevel, Term term, int docFreq, float boost, TermStates states)`
`protected void`
MultiTermQuery.TopTermsScoringBooleanQueryRewrite.`addClause(BooleanQuery.Builder topLevel, Term term, int docCount, float boost, TermStates states)`
`SynonymQuery.Builder`
SynonymQuery.Builder.`addTerm(Term term)`
Adds the provided `term` as a synonym.
`SynonymQuery.Builder`
SynonymQuery.Builder.`addTerm(Term term, float boost)`
Adds the provided `term` as a synonym, document frequencies of this term will be boosted by `boost`.
`void`
QueryVisitor.`consumeTerms(Query query, Term... terms)`
Called by leaf queries that match on specific terms
`TermStatistics`
IndexSearcher.`termStatistics(Term term, int docFreq, long totalTermFreq)`
Returns `TermStatistics` for a term.
`static Automaton`
WildcardQuery.`toAutomaton(Term wildcardquery, int determinizeWorkLimit)`
Convert Lucene wildcard syntax into an automaton.
Method parameters in org.apache.lucene.search with type arguments of type Term
Modifier and Type
Method
Description
`static QueryVisitor`
QueryVisitor.`termCollector(Set<Term> termSet)`
Builds a `QueryVisitor` instance that collects all terms that may match a query
Constructors in org.apache.lucene.search with parameters of type Term
Modifier
Constructor
Description
``
`AutomatonQuery(Term term, Automaton automaton)`
Create a new AutomatonQuery from an `Automaton`.
``
`AutomatonQuery(Term term, Automaton automaton, boolean isBinary)`
Create a new AutomatonQuery from an `Automaton`.
``
`AutomatonQuery(Term term, Automaton automaton, boolean isBinary, MultiTermQuery.RewriteMethod rewriteMethod)`
Create a new AutomatonQuery from an `Automaton`.
``
`FuzzyQuery(Term term)`
Calls `FuzzyQuery(term, defaultMaxEdits)`.
``
`FuzzyQuery(Term term, int maxEdits)`
Calls `FuzzyQuery(term, maxEdits, defaultPrefixLength)`.
``
`FuzzyQuery(Term term, int maxEdits, int prefixLength)`
Calls `FuzzyQuery(term, maxEdits, prefixLength, defaultMaxExpansions, defaultTranspositions)`.
``
`FuzzyQuery(Term term, int maxEdits, int prefixLength, int maxExpansions, boolean transpositions)`
Calls `FuzzyQuery(Term, int, int, int, boolean, org.apache.lucene.search.MultiTermQuery.RewriteMethod)` FuzzyQuery(term, maxEdits, prefixLength, maxExpansions, defaultRewriteMethod(maxExpansions))
``
`FuzzyQuery(Term term, int maxEdits, int prefixLength, int maxExpansions, boolean transpositions, MultiTermQuery.RewriteMethod rewriteMethod)`
Create a new FuzzyQuery that will match terms with an edit distance of at most `maxEdits` to `term`.
``
`FuzzyTermsEnum(Terms terms, Term term, int maxEdits, int prefixLength, boolean transpositions)`
Constructor for enumeration of all terms from specified `reader` which share a prefix of length `prefixLength` with `term` and which have at most `maxEdits` edits.
``
`PostingsAndFreq(PostingsEnum postings, ImpactsEnum impacts, int position, Term... terms)`
Creates PostingsAndFreq instance
``
`PrefixQuery(Term prefix)`
Constructs a query for terms starting with `prefix`.
``
`PrefixQuery(Term prefix, MultiTermQuery.RewriteMethod rewriteMethod)`
Constructs a query for terms starting with `prefix` using a defined RewriteMethod
``
`RegexpQuery(Term term)`
Constructs a query for terms matching `term`.
``
`RegexpQuery(Term term, int flags)`
Constructs a query for terms matching `term`.
``
`RegexpQuery(Term term, int flags, int determinizeWorkLimit)`
Constructs a query for terms matching `term`.
``
`RegexpQuery(Term term, int syntaxFlags, int matchFlags, int determinizeWorkLimit)`
Constructs a query for terms matching `term`.
``
`RegexpQuery(Term term, int syntaxFlags, int matchFlags, AutomatonProvider provider, int determinizeWorkLimit, MultiTermQuery.RewriteMethod rewriteMethod)`
Constructs a query for terms matching `term`.
``
`RegexpQuery(Term term, int syntaxFlags, int matchFlags, AutomatonProvider provider, int determinizeWorkLimit, MultiTermQuery.RewriteMethod rewriteMethod, boolean doDeterminization)`
Constructs a query for terms matching `term`.
``
`RegexpQuery(Term term, int syntaxFlags, AutomatonProvider provider, int determinizeWorkLimit)`
Constructs a query for terms matching `term`.
``
`TermQuery(Term t)`
Constructs a query for the term `t`.
``
`TermQuery(Term t, TermStates states)`
Expert: constructs a TermQuery that will use the provided docFreq instead of looking up the docFreq against the searcher.
``
`WildcardQuery(Term term)`
Constructs a query for terms matching `term`.
``
`WildcardQuery(Term term, int determinizeWorkLimit)`
Constructs a query for terms matching `term`.
``
`WildcardQuery(Term term, int determinizeWorkLimit, MultiTermQuery.RewriteMethod rewriteMethod)`
Constructs a query for terms matching `term`.
Constructor parameters in org.apache.lucene.search with type arguments of type Term
Modifier
Constructor
Description
``
`PostingsAndFreq(PostingsEnum postings, ImpactsEnum impacts, int position, List<Term> terms)`

## Uses of Term in org.apache.lucene.util

Methods in org.apache.lucene.util with parameters of type Term
Modifier and Type
Method
Description
`protected Query`
QueryBuilder.`newTermQuery(Term term, float boost)`
Builds a new TermQuery instance.

## Uses of Term in org.apache.lucene.util.graph

Methods in org.apache.lucene.util.graph that return Term
Modifier and Type
Method
Description
`Term[]`
GraphTokenStreamFiniteStrings.`getTerms(String field, int state)`
Returns the list of terms that start at the provided state