
- Lucene - Home
- Lucene - Overview
- Lucene - Environment Setup
- Lucene - First Application
- Lucene - Indexing Classes
- Lucene - Searching Classes
- Lucene - Indexing Process
- Lucene - Search Operation
- Lucene - Sorting
Lucene - Indexing Operations
- Lucene - Indexing Operations
- Lucene - Add Document
- Lucene - Update Document
- Lucene - Delete Document
- Lucene - Field Options
Lucene - Query Programming
- Lucene - Query Programming
- Lucene - TermQuery
- Lucene - TermRangeQuery
- Lucene - PrefixQuery
- Lucene - BooleanQuery
- Lucene - PhraseQuery
- Lucene - WildCardQuery
- Lucene - FuzzyQuery
- Lucene - MatchAllDocsQuery
- Lucene - MatchNoDocsQuery
- Lucene - RegexpQuery
Lucene - Analysis
- Lucene - Analysis
- Lucene - WhitespaceAnalyzer
- Lucene - SimpleAnalyzer
- Lucene - StopAnalyzer
- Lucene - StandardAnalyzer
- Lucene - KeywordAnalyzer
- Lucene - CustomAnalyzer
- Lucene - EnglishAnalyzer
- Lucene - FrenchAnalyzer
- Lucene - SpanishAnalyzer
Lucene - Resources
Lucene - Term Class
This class is the lowest unit of searching. It is similar to Field in indexing process.
Class Declaration
Following is the declaration for org.apache.lucene.index.Term class −
public final class Term extends Object implements Comparable<Term>, Accountable
Class Constructors
Following table shows the constructors for Term −
S.No. | Constructors & Description |
---|---|
1 |
Term(String fld) Constructs a Term with the given field and empty text. |
2 |
Term(String fld, String text) Constructs a Term with the given field and text. |
3 |
Term(String fld, BytesRef bytes) Constructs a Term with the given field and bytes. |
4 |
Term(String fld, BytesRefBuilder bytesBuilder) Constructs a Term with the given field and the bytes from a builder. |
Class Methods
S.No. | Method & Description |
---|---|
1 |
BytesRef bytes() Returns the bytes of this term, these should not be modified. |
2 |
int 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. |
3 |
boolean equals(Object obj) Compares objects for equality. |
4 |
String field() Returns the field of this term. |
5 |
int hashCode() Returns the hashcode of this term. |
6 |
long ramBytesUsed() Return the memory usage of this object in bytes. |
7 |
String text() Returns the text of this term. |
8 |
String toString() Returns String representation. |
9 |
static String toString(BytesRef termText) Returns human-readable form of the term text. |
Methods Inherited
This class inherits methods from the following classes −
- java.lang.Object