## Uses of Class
org.apache.lucene.search.Query

- Packages that use Query
  Package | Description
  --- | ---
  org.apache.lucene.index | Code to maintain and access indices.
  org.apache.lucene.search | Code to search indices.
  org.apache.lucene.search.spans | The calculus of spans.
  org.apache.lucene.util | Some utility classes.

- - ### Uses of Query in org.apache.lucene.index

    Methods in org.apache.lucene.index with parameters of type Query
    Modifier and Type | Method and Description
    --- | ---
    `void` | IndexWriter.`deleteDocuments(Query... queries)` Deletes the document(s) matching any of the provided queries.
    `long` | TrackingIndexWriter.`deleteDocuments(Query... queries)` Calls `IndexWriter.deleteDocuments(Query...)` and returns the generation that reflects this change.
    `long` | TrackingIndexWriter.`deleteDocuments(Query q)` Calls `IndexWriter.deleteDocuments(Query...)` and returns the generation that reflects this change.

  - ### Uses of Query in org.apache.lucene.search

    Subclasses of Query in org.apache.lucene.search
    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` | `BoostQuery` A `Query` wrapper that allows to give a boost to the wrapped query.
    `class` | `CachingWrapperFilter` Deprecated. Use `CachingWrapperQuery` and `BooleanClause.Occur.FILTER` clauses instead
    `class` | `CachingWrapperQuery` Deprecated. Use a `QueryCache` instead, such as `LRUQueryCache`.
    `class` | `ConstantScoreQuery` A query that wraps another query and simply returns a constant score equal to 1 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` Deprecated. Use `Query` objects instead: when queries are wrapped in a `ConstantScoreQuery` or in a `BooleanClause.Occur.FILTER` clause, they automatically disable the score computation so the `Filter` class does not provide benefits compared to queries anymore.
    `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` A generalized version of `PhraseQuery`, with an added method `MultiPhraseQuery.add(Term[])` for adding more than one term at the same position that are treated as a disjunction (OR).
    `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` Deprecated. You can use `Query` objects directly for filtering by using `BooleanClause.Occur.FILTER` clauses in a `BooleanQuery`.
    `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.

    Fields in org.apache.lucene.search declared as Query
    Modifier and Type | Field and Description
    --- | ---
    `protected Query` | Weight.`parentQuery`

    Methods in org.apache.lucene.search that return 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()` Deprecated. Cloning was only useful for modifying boosts. Now that `setBoost(float)` is deprecated, queries should be considered immutable.
    `Query` | Weight.`getQuery()` The query that this concerns.
    `Query` | BoostQuery.`getQuery()` Return the wrapped `Query`.
    `Query` | BooleanClause.`getQuery()`
    `Query` | ConstantScoreQuery.`getQuery()` Returns the encapsulated query.
    `Query` | FilteredQuery.`getQuery()` Deprecated. Returns this FilteredQuery's (unfiltered) Query
    `Query` | CachingWrapperQuery.`getQuery()` Deprecated. Gets the contained query.
    `Query` | QueryWrapperFilter.`getQuery()` Deprecated. returns the inner Query
    `abstract Query` | FilteredQuery.FilterStrategy.`rewrite(Filter filter)` Rewrite the filter.
    `Query` | FilteredQuery.RandomAccessFilterStrategy.`rewrite(Filter filter)`
    `Query` | BooleanQuery.`rewrite(IndexReader reader)`
    `Query` | BlendedTermQuery.`rewrite(IndexReader reader)`
    `Query` | Filter.`rewrite(IndexReader reader)` Deprecated.
    `Query` | MultiTermQuery.`rewrite(IndexReader reader)` To rewrite to a simpler form, instead return a simpler enum from `MultiTermQuery.getTermsEnum(Terms, AttributeSource)`.
    `Query` | BoostQuery.`rewrite(IndexReader reader)`
    `Query` | DisjunctionMaxQuery.`rewrite(IndexReader reader)` Optimize our representation and our subqueries representations
    `Query` | Query.`rewrite(IndexReader reader)` Expert: called to re-write queries into primitive queries.
    `Query` | PhraseQuery.`rewrite(IndexReader reader)`
    `Query` | MultiPhraseQuery.`rewrite(IndexReader reader)`
    `Query` | ConstantScoreQuery.`rewrite(IndexReader reader)`
    `Query` | FilteredQuery.`rewrite(IndexReader reader)` Deprecated.
    `Query` | MatchNoDocsQuery.`rewrite(IndexReader reader)`
    `Query` | CachingWrapperQuery.`rewrite(IndexReader reader)` Deprecated.
    `Query` | NGramPhraseQuery.`rewrite(IndexReader reader)`
    `Query` | QueryWrapperFilter.`rewrite(IndexReader reader)` Deprecated.
    `Query` | DocTermOrdsRewriteMethod.`rewrite(IndexReader reader, MultiTermQuery query)` Deprecated.
    `Query` | ScoringRewrite.`rewrite(IndexReader reader, MultiTermQuery query)`
    `abstract Query` | MultiTermQuery.RewriteMethod.`rewrite(IndexReader reader, MultiTermQuery query)`
    `Query` | DocValuesRewriteMethod.`rewrite(IndexReader reader, MultiTermQuery query)`
    `Query` | TopTermsRewrite.`rewrite(IndexReader reader, MultiTermQuery query)`
    `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

    Methods in org.apache.lucene.search that return types with arguments of type Query
    Modifier and Type | Method and Description
    --- | ---
    `ArrayList<Query>` | DisjunctionMaxQuery.`getDisjuncts()`
    `Iterator<Query>` | DisjunctionMaxQuery.`iterator()`

    Methods in org.apache.lucene.search with parameters of type Query
    Modifier and Type | Method and Description
    --- | ---
    `void` | DisjunctionMaxQuery.`add(Query query)` Deprecated. Use `DisjunctionMaxQuery.DisjunctionMaxQuery(Collection, float)` instead and provide all clauses at construction time
    `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 new clause to this `BooleanQuery.Builder`.
    `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` | QueryCachingPolicy.`onUse(Query query)` Callback that is called every time that a cached filter is used.
    `void` | QueryCachingPolicy.CacheOnLargeSegments.`onUse(Query query)`
    `void` | UsageTrackingQueryCachingPolicy.`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> 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` | 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)`
    `boolean` | UsageTrackingQueryCachingPolicy.`shouldCache(Query query, LeafReaderContext context)`
    `protected Query` | IndexSearcher.`wrapFilter(Query query, Filter filter)` Deprecated. Use `boolean queries` with `BooleanClause.Occur.FILTER` clauses instead

    Method parameters in org.apache.lucene.search with type arguments of type Query
    Modifier and Type | Method and Description
    --- | ---
    `void` | DisjunctionMaxQuery.`add(Collection<Query> disjuncts)` Deprecated. Use `DisjunctionMaxQuery.DisjunctionMaxQuery(Collection, float)` instead and provide all clauses at construction time

    Constructors in org.apache.lucene.search with parameters of type Query
    Constructor and Description
    `BooleanClause(Query query, BooleanClause.Occur occur)` Constructs a BooleanClause.
    `BoostQuery(Query query, float boost)` Sole constructor: wrap `query` in such a way that the produced scores will be boosted by `boost`.
    `CachingWrapperQuery(Query query)` Deprecated. Same as `CachingWrapperQuery.CachingWrapperQuery(Query, QueryCachingPolicy)` but enforces the use of the `QueryCachingPolicy.CacheOnLargeSegments.DEFAULT` policy.
    `CachingWrapperQuery(Query query, QueryCachingPolicy policy)` Deprecated. 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)` Deprecated. 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 parameters in org.apache.lucene.search with type arguments of type Query
    Constructor and Description
    `DisjunctionMaxQuery(Collection<Query> disjuncts, float tieBreakerMultiplier)` Creates a new DisjunctionMaxQuery

  - ### Uses of Query in org.apache.lucene.search.spans

    Subclasses of Query in org.apache.lucene.search.spans
    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` | `SpanBoostQuery` Counterpart of `BoostQuery` for spans.
    `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.

    Methods in org.apache.lucene.search.spans that return Query
    Modifier and Type | Method and Description
    --- | ---
    `Query` | SpanMultiTermQueryWrapper.`getWrappedQuery()` Returns the wrapped query
    `Query` | FieldMaskingSpanQuery.`rewrite(IndexReader reader)`
    `Query` | SpanQuery.`rewrite(IndexReader reader)`
    `Query` | SpanNotQuery.`rewrite(IndexReader reader)`
    `Query` | SpanPositionCheckQuery.`rewrite(IndexReader reader)`
    `Query` | SpanOrQuery.`rewrite(IndexReader reader)`
    `Query` | SpanMultiTermQueryWrapper.`rewrite(IndexReader reader)`
    `Query` | SpanBoostQuery.`rewrite(IndexReader reader)`
    `Query` | SpanNearQuery.`rewrite(IndexReader reader)`

  - ### Uses of Query in org.apache.lucene.util

    Methods in org.apache.lucene.util that return Query
    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-2017 Apache Software Foundation. All Rights Reserved.