Package | Description |
---|---|
org.apache.lucene.index |
Code to maintain and access indices.
|
org.apache.lucene.queryParser |
A simple query parser implemented with JavaCC.
|
org.apache.lucene.search |
Code to search indices.
|
org.apache.lucene.search.function |
Programmatic control over documents scores.
|
org.apache.lucene.search.payloads |
The payloads package provides Query mechanisms for finding and using payloads.
|
org.apache.lucene.search.spans |
The calculus of spans.
|
Modifier and Type | Method and Description |
---|---|
void |
IndexWriter.deleteDocuments(Query... queries)
Deletes the document(s) matching any of the provided queries.
|
void |
IndexWriter.deleteDocuments(Query query)
Deletes the document(s) matching the provided query.
|
Modifier and Type | Method and Description |
---|---|
Query |
QueryParser.Clause(String field) |
protected Query |
QueryParser.getBooleanQuery(List<BooleanClause> clauses)
Factory method for generating query, given a set of clauses.
|
protected Query |
QueryParser.getBooleanQuery(List<BooleanClause> clauses,
boolean disableCoord)
Factory method for generating query, given a set of clauses.
|
protected Query |
QueryParser.getFieldQuery(String field,
String queryText)
Deprecated.
Use
QueryParser.getFieldQuery(String,String,boolean) instead. |
protected Query |
MultiFieldQueryParser.getFieldQuery(String field,
String queryText,
boolean quoted) |
protected Query |
QueryParser.getFieldQuery(String field,
String queryText,
boolean quoted) |
protected Query |
MultiFieldQueryParser.getFieldQuery(String field,
String queryText,
int slop) |
protected Query |
QueryParser.getFieldQuery(String field,
String queryText,
int slop)
Base implementation delegates to
QueryParser.getFieldQuery(String,String,boolean) . |
protected Query |
MultiFieldQueryParser.getFuzzyQuery(String field,
String termStr,
float minSimilarity) |
protected Query |
QueryParser.getFuzzyQuery(String field,
String termStr,
float minSimilarity)
Factory method for generating a query (similar to
QueryParser.getWildcardQuery(java.lang.String, java.lang.String) ). |
protected Query |
MultiFieldQueryParser.getPrefixQuery(String field,
String termStr) |
protected Query |
QueryParser.getPrefixQuery(String field,
String termStr)
Factory method for generating a query (similar to
QueryParser.getWildcardQuery(java.lang.String, java.lang.String) ). |
protected Query |
MultiFieldQueryParser.getRangeQuery(String field,
String part1,
String part2,
boolean inclusive) |
protected Query |
QueryParser.getRangeQuery(String field,
String part1,
String part2,
boolean inclusive) |
protected Query |
MultiFieldQueryParser.getWildcardQuery(String field,
String termStr) |
protected Query |
QueryParser.getWildcardQuery(String field,
String termStr)
Factory method for generating a query.
|
protected Query |
QueryParser.newFuzzyQuery(Term term,
float minimumSimilarity,
int prefixLength)
Builds a new FuzzyQuery instance
|
protected Query |
QueryParser.newMatchAllDocsQuery()
Builds a new MatchAllDocsQuery instance
|
protected Query |
QueryParser.newPrefixQuery(Term prefix)
Builds a new PrefixQuery instance
|
protected Query |
QueryParser.newRangeQuery(String field,
String part1,
String part2,
boolean inclusive)
Builds a new TermRangeQuery instance
|
protected Query |
QueryParser.newTermQuery(Term term)
Builds a new TermQuery instance
|
protected Query |
QueryParser.newWildcardQuery(Term t)
Builds a new WildcardQuery instance
|
Query |
QueryParser.parse(String query)
Parses a query string, returning a
Query . |
static Query |
MultiFieldQueryParser.parse(Version matchVersion,
String[] queries,
String[] fields,
Analyzer analyzer)
Parses a query which searches on the fields specified.
|
static Query |
MultiFieldQueryParser.parse(Version matchVersion,
String[] queries,
String[] fields,
BooleanClause.Occur[] flags,
Analyzer analyzer)
Parses a query, searching on the fields specified.
|
static Query |
MultiFieldQueryParser.parse(Version matchVersion,
String query,
String[] fields,
BooleanClause.Occur[] flags,
Analyzer analyzer)
Parses a query, searching on the fields specified.
|
Query |
QueryParser.Query(String field) |
Query |
QueryParser.Term(String field) |
Query |
QueryParser.TopLevelQuery(String field) |
Modifier and Type | Method and Description |
---|---|
protected void |
QueryParser.addClause(List<BooleanClause> clauses,
int conj,
int mods,
Query q) |
protected BooleanClause |
QueryParser.newBooleanClause(Query q,
BooleanClause.Occur occur)
Builds a new BooleanClause instance
|
Modifier and Type | Class and Description |
---|---|
static class |
Scorer.ScorerVisitor<P extends Query,C extends Query,S extends Scorer>
A callback to gather information from a scorer and its sub-scorers.
|
static class |
Scorer.ScorerVisitor<P extends Query,C extends Query,S extends Scorer>
A callback to gather information from a scorer and its sub-scorers.
|
class |
ScoringRewrite<Q extends Query> |
class |
TopTermsRewrite<Q extends Query>
Base rewrite method for collecting only the top terms
via a priority queue.
|
Modifier and Type | Class and Description |
---|---|
class |
BooleanQuery
A Query that matches documents matching boolean combinations of other
queries, e.g.
|
class |
ConstantScoreQuery
A query that wraps another query or a filter and simply returns a constant score equal to the
query boost for every document that matches the filter or query.
|
class |
DisjunctionMaxQuery
A query that generates the union of documents produced by its subqueries, and that scores each document with the maximum
score for that document as produced by any subquery, plus a tie breaking increment for any additional matching subqueries.
|
class |
FilteredQuery
A query that applies a filter to the results of another query.
|
class |
FuzzyQuery
Implements the fuzzy search query.
|
class |
MatchAllDocsQuery
A query that matches all documents.
|
class |
MultiPhraseQuery
MultiPhraseQuery is a generalized version of PhraseQuery, with an added
method
MultiPhraseQuery.add(Term[]) . |
class |
MultiTermQuery
An abstract
Query that matches documents
containing a subset of terms provided by a FilteredTermEnum enumeration. |
class |
NGramPhraseQuery
This is a
PhraseQuery which is optimized for n-gram phrase query. |
class |
NumericRangeQuery<T extends Number>
A
Query that matches numeric values within a
specified range. |
class |
PhraseQuery
A Query that matches documents containing a particular sequence of terms.
|
class |
PrefixQuery
A Query that matches documents containing terms with a specified prefix.
|
class |
TermQuery
A Query that matches documents containing a term.
|
class |
TermRangeQuery
A Query that matches documents within an range of terms.
|
class |
WildcardQuery
Implements the wildcard search query.
|
Modifier and Type | Field and Description |
---|---|
protected Query |
ConstantScoreQuery.query |
Modifier and Type | Method and Description |
---|---|
Query |
Query.combine(Query[] queries)
Expert: called when re-writing queries under MultiSearcher.
|
Query |
FilteredQuery.getQuery() |
Query |
BooleanClause.getQuery() |
Query |
ConstantScoreQuery.getQuery()
Returns the encapsulated query, returns
null if a filter is wrapped. |
Query |
ConstantScoreQuery.ConstantWeight.getQuery() |
Query |
BooleanQuery.BooleanWeight.getQuery() |
Query |
DisjunctionMaxQuery.DisjunctionMaxWeight.getQuery()
Return our associated DisjunctionMaxQuery
|
abstract Query |
Weight.getQuery()
The query that this concerns.
|
static Query |
Query.mergeBooleanQueries(BooleanQuery... queries)
Expert: merges the clauses of a set of BooleanQuery's into a single
BooleanQuery.
|
Query |
FilteredQuery.rewrite(IndexReader reader)
Rewrites the wrapped query.
|
Query |
ConstantScoreQuery.rewrite(IndexReader reader) |
Query |
MultiPhraseQuery.rewrite(IndexReader reader) |
Query |
PhraseQuery.rewrite(IndexReader reader) |
Query |
BooleanQuery.rewrite(IndexReader reader) |
Query |
DisjunctionMaxQuery.rewrite(IndexReader reader)
Optimize our representation and our subqueries representations
|
Query |
NGramPhraseQuery.rewrite(IndexReader reader) |
Query |
MultiTermQuery.rewrite(IndexReader reader)
To rewrite to a simpler form, instead return a simpler
enum from
MultiTermQuery.getEnum(IndexReader) . |
Query |
Query.rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries.
|
abstract Query |
MultiTermQuery.RewriteMethod.rewrite(IndexReader reader,
MultiTermQuery query) |
Query |
MultiSearcher.rewrite(Query original)
Deprecated.
|
Query |
Searchable.rewrite(Query query)
Deprecated.
Expert: called to re-write queries into primitive queries.
|
abstract Query |
Searcher.rewrite(Query query)
Deprecated.
|
Query |
IndexSearcher.rewrite(Query original)
Expert: called to re-write queries into primitive queries.
|
Modifier and Type | Method and Description |
---|---|
Iterator<Query> |
DisjunctionMaxQuery.iterator()
An Iterator
|
Modifier and Type | Method and Description |
---|---|
void |
DisjunctionMaxQuery.add(Query query)
Add a subquery to this disjunction
|
void |
BooleanQuery.add(Query query,
BooleanClause.Occur occur)
Adds a clause to a boolean query.
|
Query |
Query.combine(Query[] queries)
Expert: called when re-writing queries under MultiSearcher.
|
Weight |
MultiSearcher.createNormalizedWeight(Query original)
Deprecated.
Create weight in multiple index scenario.
|
Weight |
Searcher.createNormalizedWeight(Query query)
Deprecated.
Creates a normalized weight for a top-level
Query . |
Weight |
IndexSearcher.createNormalizedWeight(Query query)
Creates a normalized weight for a top-level
Query . |
protected Weight |
Searcher.createWeight(Query query)
Deprecated.
never ever use this method in
Weight implementations.
Subclasses of Searcher should use Searcher.createNormalizedWeight(org.apache.lucene.search.Query) , instead. |
long |
NRTManager.TrackingIndexWriter.deleteDocuments(Query... queries) |
long |
NRTManager.TrackingIndexWriter.deleteDocuments(Query q) |
Explanation |
Searcher.explain(Query query,
int doc)
Deprecated.
Returns an Explanation that describes how
doc scored against
query . |
Explanation |
IndexSearcher.explain(Query query,
int doc)
Returns an Explanation that describes how
doc scored against
query . |
Query |
MultiSearcher.rewrite(Query original)
Deprecated.
|
Query |
Searchable.rewrite(Query query)
Deprecated.
Expert: called to re-write queries into primitive queries.
|
abstract Query |
Searcher.rewrite(Query query)
Deprecated.
|
Query |
IndexSearcher.rewrite(Query original)
Expert: called to re-write queries into primitive queries.
|
void |
Searcher.search(Query query,
Collector results)
Deprecated.
Lower-level search API.
|
void |
IndexSearcher.search(Query query,
Collector results)
Lower-level search API.
|
void |
Searcher.search(Query query,
Filter filter,
Collector results)
Deprecated.
Lower-level search API.
|
void |
IndexSearcher.search(Query query,
Filter filter,
Collector results)
Lower-level search API.
|
TopDocs |
Searcher.search(Query query,
Filter filter,
int n)
Deprecated.
Finds the top
n
hits for query , applying filter if non-null. |
TopDocs |
IndexSearcher.search(Query query,
Filter filter,
int n)
Finds the top
n
hits for query , applying filter if non-null. |
TopFieldDocs |
Searcher.search(Query query,
Filter filter,
int n,
Sort sort)
Deprecated.
Search implementation with arbitrary sorting.
|
TopFieldDocs |
IndexSearcher.search(Query query,
Filter filter,
int n,
Sort sort)
Search implementation with arbitrary sorting.
|
TopDocs |
Searcher.search(Query query,
int n)
Deprecated.
Finds the top
n
hits for query . |
TopDocs |
IndexSearcher.search(Query query,
int n)
Finds the top
n
hits for query . |
TopFieldDocs |
Searcher.search(Query query,
int n,
Sort sort)
Deprecated.
Search implementation with arbitrary sorting and no filter.
|
TopFieldDocs |
IndexSearcher.search(Query query,
int n,
Sort sort)
Search implementation with arbitrary sorting and no filter.
|
TopDocs |
IndexSearcher.searchAfter(ScoreDoc after,
Query query,
Filter filter,
int n)
Finds the top
n
hits for query , applying filter if non-null,
where all results are after a previous result (after ). |
TopDocs |
IndexSearcher.searchAfter(ScoreDoc after,
Query query,
int n)
Finds the top
n
hits for query where all results are after a previous
result (after ). |
void |
BooleanClause.setQuery(Query query) |
protected void |
Scorer.visitSubScorers(Query parent,
BooleanClause.Occur relationship,
Scorer.ScorerVisitor<Query,Query,Scorer> visitor)
Scorer subclasses should implement this method if the subclass
itself contains multiple scorers to support gathering details for
sub-scorers via Scorer.ScorerVisitor |
Modifier and Type | Method and Description |
---|---|
void |
DisjunctionMaxQuery.add(Collection<Query> disjuncts)
Add a collection of disjuncts to this disjunction
via Iterable
|
void |
Scorer.visitScorers(Scorer.ScorerVisitor<Query,Query,Scorer> visitor)
Expert: call this to gather details for all sub-scorers for this query.
|
void |
Scorer.visitScorers(Scorer.ScorerVisitor<Query,Query,Scorer> visitor)
Expert: call this to gather details for all sub-scorers for this query.
|
protected void |
Scorer.visitSubScorers(Query parent,
BooleanClause.Occur relationship,
Scorer.ScorerVisitor<Query,Query,Scorer> visitor)
Scorer subclasses should implement this method if the subclass
itself contains multiple scorers to support gathering details for
sub-scorers via Scorer.ScorerVisitor |
protected void |
Scorer.visitSubScorers(Query parent,
BooleanClause.Occur relationship,
Scorer.ScorerVisitor<Query,Query,Scorer> visitor)
Scorer subclasses should implement this method if the subclass
itself contains multiple scorers to support gathering details for
sub-scorers via Scorer.ScorerVisitor |
Constructor and Description |
---|
BooleanClause(Query query,
BooleanClause.Occur occur)
Constructs a BooleanClause.
|
ConstantScoreQuery(Query query)
Strips off scores from the passed in Query.
|
FilteredQuery(Query query,
Filter filter)
Constructs a new query which applies a filter to the results of the original query.
|
QueryWrapperFilter(Query query)
Constructs a filter which only matches documents matching
query . |
Constructor and Description |
---|
DisjunctionMaxQuery(Collection<Query> disjuncts,
float tieBreakerMultiplier)
Creates a new DisjunctionMaxQuery
|
Modifier and Type | Class and Description |
---|---|
class |
CustomScoreQuery
Query that sets document score as a programmatic function of several (sub) scores:
the score of its subQuery (any query)
(optional) the score of its ValueSourceQuery (or queries).
|
class |
FieldScoreQuery
A query that scores each document as the value of the numeric input field.
|
class |
ValueSourceQuery
Expert: A Query that sets the scores of document to the
values obtained from a
ValueSource . |
Modifier and Type | Method and Description |
---|---|
Query |
ValueSourceQuery.rewrite(IndexReader reader) |
Query |
CustomScoreQuery.rewrite(IndexReader reader) |
Constructor and Description |
---|
CustomScoreQuery(Query subQuery)
Create a CustomScoreQuery over input subQuery.
|
CustomScoreQuery(Query subQuery,
ValueSourceQuery... valSrcQueries)
Create a CustomScoreQuery over input subQuery and a
ValueSourceQuery . |
CustomScoreQuery(Query subQuery,
ValueSourceQuery valSrcQuery)
Create a CustomScoreQuery over input subQuery and a
ValueSourceQuery . |
Modifier and Type | Class and Description |
---|---|
class |
PayloadNearQuery
This class is very similar to
SpanNearQuery except that it factors
in the value of the payloads located at each of the positions where the
TermSpans occurs. |
class |
PayloadTermQuery
This class is very similar to
SpanTermQuery except that it factors
in the value of the payload located at each of the positions where the
Term occurs. |
Modifier and Type | Method and Description |
---|---|
Collection<byte[]> |
PayloadSpanUtil.getPayloadsForQuery(Query query)
Query should be rewritten for wild/fuzzy support.
|
Modifier and Type | Class and Description |
---|---|
class |
FieldMaskingSpanQuery
Wrapper to allow
SpanQuery objects participate in composite
single-field SpanQueries by 'lying' about their search field. |
class |
SpanFirstQuery
Matches spans near the beginning of a field.
|
class |
SpanMultiTermQueryWrapper<Q extends MultiTermQuery>
Wraps any
MultiTermQuery as a SpanQuery ,
so it can be nested within other SpanQuery classes. |
class |
SpanNearPayloadCheckQuery
Only return those matches that have a specific payload at
the given position.
|
class |
SpanNearQuery
Matches spans which are near one another.
|
class |
SpanNotQuery
Removes matches which overlap with another SpanQuery.
|
class |
SpanOrQuery
Matches the union of its clauses.
|
class |
SpanPayloadCheckQuery
Only return those matches that have a specific payload at
the given position.
|
class |
SpanPositionCheckQuery
Base class for filtering a SpanQuery based on the position of a match.
|
class |
SpanPositionRangeQuery
Checks to see if the
SpanPositionCheckQuery.getMatch() lies between a start and end position |
class |
SpanQuery
Base class for span-based queries.
|
class |
SpanTermQuery
Matches spans containing a term.
|
Modifier and Type | Method and Description |
---|---|
Query |
SpanWeight.getQuery() |
Query |
SpanOrQuery.rewrite(IndexReader reader) |
Query |
SpanPositionCheckQuery.rewrite(IndexReader reader) |
Query |
SpanNotQuery.rewrite(IndexReader reader) |
Query |
SpanNearQuery.rewrite(IndexReader reader) |
Query |
FieldMaskingSpanQuery.rewrite(IndexReader reader) |
Query |
SpanMultiTermQueryWrapper.rewrite(IndexReader reader) |