
- 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 - Query Class
Query is an abstract class and contains various utility methods and is the parent of all types of queries that Lucene uses during search process.
Class Declaration
Following is the declaration for org.apache.lucene.search.Query class −
public abstract class Query extends Object
Class Constructors
Following table shows the constructors for Query −
S.No. | Constructor & Description |
---|---|
1 |
Query() Constructs a Query object. |
Class Methods
S.No. | Method & Description |
---|---|
1 |
protected final int classHash() Provides a constant integer for a given class, derived from the name of the class. |
2 |
Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) Expert: Constructs an appropriate Weight implementation for this query. |
3 |
abstract boolean equals(Object obj) Override and implement query instance equivalence properly in a subclass. |
4 |
abstract int hashCode() Override and implement query hash code properly in a subclass. |
5 |
Query rewrite(IndexSearcher indexSearcher) Expert: called to re-write queries into primitive queries. |
6 |
protected final boolean sameClassAs(Object other) Utility method to check whether other is not null and is exactly of the same class as this object's class. |
7 |
final String toString() Prints a query to a string. |
8 |
abstract String toString(String field) Prints a query to a string, with field assumed to be the default field and omitted. |
9 |
abstract void visit(QueryVisitor visitor) Recurse through the query tree, visiting any child queries. |
Methods Inherited
This class inherits methods from the following classes −
- java.lang.Object