Package | Description |
---|---|
org.apache.lucene.index |
Code to maintain and access indices.
|
org.apache.lucene.search |
Code to search indices.
|
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.
|
org.apache.lucene.util |
Some utility classes.
|
Modifier and Type | Method and Description |
---|---|
long |
TrackingIndexWriter.deleteDocuments(Query... queries)
Calls
IndexWriter.deleteDocuments(Query...)
and returns the generation that reflects this change. |
void |
IndexWriter.deleteDocuments(Query... queries)
Deletes the document(s) matching any of the provided queries.
|
long |
TrackingIndexWriter.deleteDocuments(Query q)
Calls
IndexWriter.deleteDocuments(Query...) and
returns the generation that reflects this change. |
Modifier and Type | Class and Description |
---|---|
class |
AutomatonQuery
A
Query that will match terms against a finite-state machine. |
class |
BlendedTermQuery
A
Query that blends index statistics across multiple terms. |
class |
BooleanQuery
A Query that matches documents matching boolean combinations of other
queries, e.g.
|
class |
CachingWrapperFilter
Deprecated.
Use
CachingWrapperQuery and BooleanClause.Occur.FILTER clauses instead |
class |
CachingWrapperQuery
Wraps another
Query 's result and caches it when scores are not
needed. |
class |
ConstantScoreQuery
A query that wraps another query and simply returns a constant score equal to the
query boost for every document that matches the 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 |
FieldValueFilter
Deprecated.
Use
FieldValueQuery instead |
class |
FieldValueQuery
A
Query that matches documents that have a value for a given field
as reported by LeafReader.getDocsWithField(String) . |
class |
Filter
Convenient base class for building queries that only perform matching, but
no scoring.
|
class |
FilteredQuery
Deprecated.
FilteredQuery will be removed in Lucene 6.0. It should
be replaced with a
BooleanQuery with one
BooleanClause.Occur.MUST clause for the query and one
BooleanClause.Occur.FILTER clause for the filter. |
class |
FuzzyQuery
Implements the fuzzy search query.
|
class |
MatchAllDocsQuery
A query that matches all documents.
|
class |
MatchNoDocsQuery
A query that matches no 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 FilteredTermsEnum enumeration. |
class |
MultiTermQueryWrapperFilter<Q extends MultiTermQuery>
Deprecated.
Use
MultiTermQueryConstantScoreWrapper instead |
class |
NGramPhraseQuery
This is a
PhraseQuery which is optimized for n-gram phrase query. |
class |
NumericRangeFilter<T extends Number>
Deprecated.
Use
NumericRangeQuery and BooleanClause.Occur.FILTER clauses instead. |
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 |
PrefixFilter
Deprecated.
Use
PrefixQuery and BooleanClause.Occur.FILTER clauses instead. |
class |
PrefixQuery
A Query that matches documents containing terms with a specified prefix.
|
class |
QueryWrapperFilter
Constrains search results to only match those which also match a provided
query.
|
class |
RegexpQuery
A fast regular expression query based on the
org.apache.lucene.util.automaton package. |
class |
TermQuery
A Query that matches documents containing a term.
|
class |
TermRangeFilter
Deprecated.
Use
TermRangeQuery and BooleanClause.Occur.FILTER clauses instead. |
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 |
Weight.parentQuery |
protected Query |
ConstantScoreQuery.query |
Modifier and Type | Method and Description |
---|---|
protected Query |
MultiTermQuery.TopTermsBlendedFreqScoringRewrite.build(BlendedTermQuery.Builder builder) |
protected Query |
MultiTermQuery.TopTermsScoringBooleanQueryRewrite.build(BooleanQuery.Builder builder) |
protected Query |
MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite.build(BooleanQuery.Builder builder) |
Query |
Query.clone()
Returns a clone of this query.
|
Query |
Weight.getQuery()
The query that this concerns.
|
Query |
QueryWrapperFilter.getQuery()
returns the inner Query
|
Query |
FilteredQuery.getQuery()
Deprecated.
Returns this FilteredQuery's (unfiltered) Query
|
Query |
ConstantScoreQuery.getQuery()
Returns the encapsulated query.
|
Query |
CachingWrapperQuery.getQuery()
Gets the contained query.
|
Query |
BooleanClause.getQuery() |
abstract Query |
FilteredQuery.FilterStrategy.rewrite(Filter filter)
Rewrite the filter.
|
Query |
FilteredQuery.RandomAccessFilterStrategy.rewrite(Filter filter) |
Query |
QueryWrapperFilter.rewrite(IndexReader reader) |
Query |
Query.rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries.
|
Query |
PhraseQuery.rewrite(IndexReader reader) |
Query |
NGramPhraseQuery.rewrite(IndexReader reader) |
Query |
MultiTermQuery.rewrite(IndexReader reader)
To rewrite to a simpler form, instead return a simpler
enum from
MultiTermQuery.getTermsEnum(Terms, AttributeSource) . |
Query |
MultiPhraseQuery.rewrite(IndexReader reader) |
Query |
MatchNoDocsQuery.rewrite(IndexReader reader) |
Query |
FilteredQuery.rewrite(IndexReader reader)
Deprecated.
|
Query |
Filter.rewrite(IndexReader reader) |
Query |
DisjunctionMaxQuery.rewrite(IndexReader reader)
Optimize our representation and our subqueries representations
|
Query |
ConstantScoreQuery.rewrite(IndexReader reader) |
Query |
CachingWrapperQuery.rewrite(IndexReader reader) |
Query |
BooleanQuery.rewrite(IndexReader reader) |
Query |
BlendedTermQuery.rewrite(IndexReader reader) |
Query |
TopTermsRewrite.rewrite(IndexReader reader,
MultiTermQuery query) |
Query |
ScoringRewrite.rewrite(IndexReader reader,
MultiTermQuery query) |
abstract Query |
MultiTermQuery.RewriteMethod.rewrite(IndexReader reader,
MultiTermQuery query) |
Query |
DocValuesRewriteMethod.rewrite(IndexReader reader,
MultiTermQuery query) |
Query |
DocTermOrdsRewriteMethod.rewrite(IndexReader reader,
MultiTermQuery query)
Deprecated.
|
Query |
IndexSearcher.rewrite(Query original)
Expert: called to re-write queries into primitive queries.
|
abstract Query |
BlendedTermQuery.RewriteMethod.rewrite(Query[] subQueries)
Merge the provided sub queries into a single
Query object. |
Query |
BlendedTermQuery.DisjunctionMaxRewrite.rewrite(Query[] subQueries) |
protected Query |
IndexSearcher.wrapFilter(Query query,
Filter filter)
Deprecated.
Use
boolean queries with
BooleanClause.Occur.FILTER clauses instead |
Modifier and Type | Method and Description |
---|---|
ArrayList<Query> |
DisjunctionMaxQuery.getDisjuncts() |
Iterator<Query> |
DisjunctionMaxQuery.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)
Deprecated.
Boolean queries should be created once with
BooleanQuery.Builder
and then considered immutable. See BooleanQuery.Builder.add(org.apache.lucene.search.BooleanClause) . |
BooleanQuery.Builder |
BooleanQuery.Builder.add(Query query,
BooleanClause.Occur occur)
Add a clause to the
BooleanQuery . |
void |
LRUQueryCache.clearQuery(Query query)
Remove all cache entries for the given query.
|
int |
IndexSearcher.count(Query query)
Count how many documents match the given query.
|
Weight |
IndexSearcher.createNormalizedWeight(Query query,
boolean needsScores)
Creates a normalized weight for a top-level
Query . |
Weight |
IndexSearcher.createWeight(Query query,
boolean needsScores)
Creates a
Weight for the given query, potentially adding caching
if possible and configured. |
Explanation |
IndexSearcher.explain(Query query,
int doc)
Returns an Explanation that describes how
doc scored against
query . |
protected int |
UsageTrackingQueryCachingPolicy.minFrequencyToCache(Query query)
For a given query, return how many times it should appear in the history
before being cached.
|
protected void |
LRUQueryCache.onHit(Object readerCoreKey,
Query query)
Expert: callback when there is a cache hit on a given query.
|
protected void |
LRUQueryCache.onMiss(Object readerCoreKey,
Query query)
Expert: callback when there is a cache miss on a given query.
|
protected void |
LRUQueryCache.onQueryCache(Query query,
long ramBytesUsed)
Expert: callback when a query is added to this cache.
|
protected void |
LRUQueryCache.onQueryEviction(Query query,
long ramBytesUsed)
Expert: callback when a query is evicted from this cache.
|
void |
UsageTrackingQueryCachingPolicy.onUse(Query query) |
void |
QueryCachingPolicy.onUse(Query query)
Callback that is called every time that a cached filter is used.
|
void |
QueryCachingPolicy.CacheOnLargeSegments.onUse(Query query) |
protected long |
LRUQueryCache.ramBytesUsed(Query query)
Return the number of bytes used by the given query.
|
static TopDocs |
QueryRescorer.rescore(IndexSearcher searcher,
TopDocs topDocs,
Query query,
double weight,
int topN)
Sugar API, calling {#rescore} using a simple linear
combination of firstPassScore + weight * secondPassScore
|
Query |
IndexSearcher.rewrite(Query original)
Expert: called to re-write queries into primitive queries.
|
abstract Query |
BlendedTermQuery.RewriteMethod.rewrite(Query[] subQueries)
Merge the provided sub queries into a single
Query object. |
Query |
BlendedTermQuery.DisjunctionMaxRewrite.rewrite(Query[] subQueries) |
void |
IndexSearcher.search(Query query,
Collector results)
Lower-level search API.
|
<C extends Collector,T> |
IndexSearcher.search(Query query,
CollectorManager<C,T> collectorManager)
Lower-level search API.
|
void |
IndexSearcher.search(Query query,
Filter filter,
Collector results)
Deprecated.
Use
boolean queries with
BooleanClause.Occur.FILTER clauses instead |
TopDocs |
IndexSearcher.search(Query query,
Filter filter,
int n)
Deprecated.
Use
boolean queries with
BooleanClause.Occur.FILTER clauses instead |
TopFieldDocs |
IndexSearcher.search(Query query,
Filter filter,
int n,
Sort sort)
Deprecated.
Use
boolean queries with
BooleanClause.Occur.FILTER clauses instead |
TopFieldDocs |
IndexSearcher.search(Query query,
Filter filter,
int n,
Sort sort,
boolean doDocScores,
boolean doMaxScore)
Deprecated.
Use
boolean queries with
BooleanClause.Occur.FILTER clauses instead |
TopDocs |
IndexSearcher.search(Query query,
int n)
Finds the top
n
hits for query . |
TopFieldDocs |
IndexSearcher.search(Query query,
int n,
Sort sort)
Search implementation with arbitrary sorting and no filter.
|
TopFieldDocs |
IndexSearcher.search(Query query,
int n,
Sort sort,
boolean doDocScores,
boolean doMaxScore)
Search implementation with arbitrary sorting, plus
control over whether hit scores and max score
should be computed.
|
TopDocs |
IndexSearcher.searchAfter(ScoreDoc after,
Query query,
Filter filter,
int n)
Deprecated.
Use
boolean queries with
BooleanClause.Occur.FILTER clauses instead |
TopFieldDocs |
IndexSearcher.searchAfter(ScoreDoc after,
Query query,
Filter filter,
int n,
Sort sort)
Deprecated.
Use
boolean queries with
BooleanClause.Occur.FILTER clauses instead |
TopFieldDocs |
IndexSearcher.searchAfter(ScoreDoc after,
Query query,
Filter filter,
int numHits,
Sort sort,
boolean doDocScores,
boolean doMaxScore)
Deprecated.
Use
boolean queries with
BooleanClause.Occur.FILTER clauses instead |
TopDocs |
IndexSearcher.searchAfter(ScoreDoc after,
Query query,
int numHits)
Finds the top
n
hits for query where all results are after a previous
result (after ). |
TopDocs |
IndexSearcher.searchAfter(ScoreDoc after,
Query query,
int n,
Sort sort)
Finds the top
n
hits for query where all results are after a previous
result (after ). |
TopFieldDocs |
IndexSearcher.searchAfter(ScoreDoc after,
Query query,
int numHits,
Sort sort,
boolean doDocScores,
boolean doMaxScore)
Finds the top
n
hits for query where all results are after a previous
result (after ), allowing control over
whether hit scores and max score should be computed. |
void |
BooleanClause.setQuery(Query query)
Deprecated.
BooleanClause will be immutable in 6.0.
|
boolean |
UsageTrackingQueryCachingPolicy.shouldCache(Query query,
LeafReaderContext context) |
boolean |
QueryCachingPolicy.shouldCache(Query query,
LeafReaderContext context)
Whether the given
DocIdSet should be cached on a given segment. |
boolean |
QueryCachingPolicy.CacheOnLargeSegments.shouldCache(Query query,
LeafReaderContext context) |
protected Query |
IndexSearcher.wrapFilter(Query query,
Filter filter)
Deprecated.
Use
boolean queries with
BooleanClause.Occur.FILTER clauses instead |
Modifier and Type | Method and Description |
---|---|
void |
DisjunctionMaxQuery.add(Collection<Query> disjuncts)
Add a collection of disjuncts to this disjunction
via
Iterable<Query> |
Constructor and Description |
---|
BooleanClause(Query query,
BooleanClause.Occur occur)
Constructs a BooleanClause.
|
CachingWrapperQuery(Query query)
Same as
CachingWrapperQuery.CachingWrapperQuery(Query, QueryCachingPolicy)
but enforces the use of the
QueryCachingPolicy.CacheOnLargeSegments.DEFAULT policy. |
CachingWrapperQuery(Query query,
QueryCachingPolicy policy)
Wraps another query's result and caches it according to the provided policy.
|
ConstantScoreQuery(Query query)
Strips off scores from the passed in Query.
|
ConstantScoreWeight(Query query) |
FilteredQuery(Query query,
Filter filter)
Deprecated.
Constructs a new query which applies a filter to the results of the original query.
|
FilteredQuery(Query query,
Filter filter,
FilteredQuery.FilterStrategy strategy)
Deprecated.
Expert: Constructs a new query which applies a filter to the results of the original query.
|
QueryRescorer(Query query)
Sole constructor, passing the 2nd pass query to
assign scores to the 1st pass hits.
|
QueryWrapperFilter(Query query)
Constructs a filter which only matches documents matching
query . |
RandomAccessWeight(Query query)
Sole constructor.
|
Weight(Query query)
Sole constructor, typically invoked by sub-classes.
|
Constructor and Description |
---|
DisjunctionMaxQuery(Collection<Query> disjuncts,
float tieBreakerMultiplier)
Creates a new DisjunctionMaxQuery
|
Modifier and Type | Class and Description |
---|---|
class |
PayloadNearQuery
Deprecated.
use
PayloadScoreQuery to wrap SpanNearQuery |
class |
PayloadScoreQuery
A Query class that uses a
PayloadFunction to modify the score of a
wrapped SpanQuery
NOTE: In order to take advantage of this with the default scoring implementation
(DefaultSimilarity ), you must override DefaultSimilarity.scorePayload(int, int, int, BytesRef) ,
which returns 1 by default. |
class |
PayloadTermQuery
Deprecated.
use
PayloadScoreQuery to wrap SpanTermQuery |
class |
SpanNearPayloadCheckQuery
Deprecated.
|
class |
SpanPayloadCheckQuery
Only return those matches that have a specific payload at the given position.
|
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 |
SpanContainingQuery
Keep matches that contain another Spans.
|
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 |
SpanNearQuery
Matches spans which are near one another.
|
class |
SpanNotQuery
Removes matches which overlap with another SpanQuery or which are
within x tokens before or y tokens after another SpanQuery.
|
class |
SpanOrQuery
Matches the union of its clauses.
|
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
See SpanFirstQuery for a derivation that is optimized for the case where start position is 0. |
class |
SpanQuery
Base class for span-based queries.
|
class |
SpanTermQuery
Matches spans containing a term.
|
class |
SpanWithinQuery
Keep matches that are contained within another Spans.
|
Modifier and Type | Method and Description |
---|---|
Query |
SpanMultiTermQueryWrapper.getWrappedQuery()
Returns the wrapped query
|
Query |
SpanPositionCheckQuery.rewrite(IndexReader reader) |
Query |
SpanOrQuery.rewrite(IndexReader reader) |
Query |
SpanNotQuery.rewrite(IndexReader reader) |
Query |
SpanNearQuery.rewrite(IndexReader reader) |
Query |
SpanMultiTermQueryWrapper.rewrite(IndexReader reader) |
Query |
FieldMaskingSpanQuery.rewrite(IndexReader reader) |
Modifier and Type | Method and Description |
---|---|
Query |
QueryBuilder.createBooleanQuery(String field,
String queryText)
Creates a boolean query from the query text.
|
Query |
QueryBuilder.createBooleanQuery(String field,
String queryText,
BooleanClause.Occur operator)
Creates a boolean query from the query text.
|
protected Query |
QueryBuilder.createFieldQuery(Analyzer analyzer,
BooleanClause.Occur operator,
String field,
String queryText,
boolean quoted,
int phraseSlop)
Creates a query from the analysis chain.
|
Query |
QueryBuilder.createMinShouldMatchQuery(String field,
String queryText,
float fraction)
Creates a minimum-should-match query from the query text.
|
Query |
QueryBuilder.createPhraseQuery(String field,
String queryText)
Creates a phrase query from the query text.
|
Query |
QueryBuilder.createPhraseQuery(String field,
String queryText,
int phraseSlop)
Creates a phrase query from the query text.
|
protected Query |
QueryBuilder.newTermQuery(Term term)
Builds a new TermQuery instance.
|
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.