Uses of Class
org.apache.lucene.search.Query
-
-
Uses of Query in org.apache.lucene.document
Subclasses of Query in org.apache.lucene.document Modifier and Type Class Description classLatLonDocValuesPointInPolygonQueryPolygon query forLatLonDocValuesField.Methods in org.apache.lucene.document that return Query Modifier and Type Method Description static QueryLatLonPoint. newBoxQuery(String field, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude)Create a query for matching a bounding box.static QueryLatLonShape. newBoxQuery(String field, ShapeField.QueryRelation queryRelation, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude)create a query to find all indexed geo shapes that intersect a defined bounding boxstatic QueryDoubleRange. newContainsQuery(String field, double[] min, double[] max)Create a query for matching indexed ranges that contain the defined range.static QueryFloatRange. newContainsQuery(String field, float[] min, float[] max)Create a query for matching indexed float ranges that contain the defined range.static QueryInetAddressRange. newContainsQuery(String field, InetAddress min, InetAddress max)Create a query for matching indexed ip ranges thatCONTAINSthe defined range.static QueryIntRange. newContainsQuery(String field, int[] min, int[] max)Create a query for matching indexed ranges that contain the defined range.static QueryLongRange. newContainsQuery(String field, long[] min, long[] max)Create a query for matching indexed ranges that contain the defined range.static QueryDoubleRange. newCrossesQuery(String field, double[] min, double[] max)Create a query for matching indexed ranges that cross the defined range.static QueryFloatRange. newCrossesQuery(String field, float[] min, float[] max)Create a query for matching indexed ranges that cross the defined range.static QueryInetAddressRange. newCrossesQuery(String field, InetAddress min, InetAddress max)Create a query for matching indexed ip ranges thatCROSSthe defined range.static QueryIntRange. newCrossesQuery(String field, int[] min, int[] max)Create a query for matching indexed ranges that cross the defined range.static QueryLongRange. newCrossesQuery(String field, long[] min, long[] max)Create a query for matching indexed ranges that cross the defined range.static QueryLatLonPoint. newDistanceFeatureQuery(String field, float weight, double originLat, double originLon, double pivotDistanceMeters)Given a field that indexes point values into aLatLonPointand doc values intoLatLonDocValuesField, this returns a query that scores documents based on their haversine distance in meters to(originLat, originLon):score = weight * pivotDistanceMeters / (pivotDistanceMeters + distance), ie.static QueryLongPoint. newDistanceFeatureQuery(String field, float weight, long origin, long pivotDistance)Given a field that indexes the same long values into aLongPointand doc values (eitherNumericDocValuesFieldorSortedNumericDocValuesField), this returns a query that scores documents based on their distance toorigin:score = weight * pivotDistance / (pivotDistance + distance), ie.static QueryLatLonPoint. newDistanceQuery(String field, double latitude, double longitude, double radiusMeters)Create a query for matching points within the specified distance of the supplied location.static QueryDoublePoint. newExactQuery(String field, double value)Create a query for matching an exact double value.static QueryFloatPoint. newExactQuery(String field, float value)Create a query for matching an exact float value.static QueryHalfFloatPoint. newExactQuery(String field, float value)Create a query for matching an exact half-float value.static QueryInetAddressPoint. newExactQuery(String field, InetAddress value)Create a query for matching a network address.static QueryIntPoint. newExactQuery(String field, int value)Create a query for matching an exact integer value.static QueryLongPoint. newExactQuery(String field, long value)Create a query for matching an exact long value.static QueryDoubleRange. newIntersectsQuery(String field, double[] min, double[] max)Create a query for matching indexed ranges that intersect the defined range.static QueryFloatRange. newIntersectsQuery(String field, float[] min, float[] max)Create a query for matching indexed ranges that intersect the defined range.static QueryInetAddressRange. newIntersectsQuery(String field, InetAddress min, InetAddress max)Create a query for matching indexed ip ranges thatINTERSECTthe defined range.static QueryIntRange. newIntersectsQuery(String field, int[] min, int[] max)Create a query for matching indexed ranges that intersect the defined range.static QueryLongRange. newIntersectsQuery(String field, long[] min, long[] max)Create a query for matching indexed ranges that intersect the defined range.static QueryLatLonShape. newLineQuery(String field, ShapeField.QueryRelation queryRelation, Line... lines)create a query to find all indexed geo shapes that intersect a provided linestring (or array of linestrings) note: does not support dateline crossingstatic QueryLatLonPoint. newPolygonQuery(String field, Polygon... polygons)Create a query for matching one or more polygons.static QueryLatLonShape. newPolygonQuery(String field, ShapeField.QueryRelation queryRelation, Polygon... polygons)create a query to find all indexed geo shapes that intersect a provided polygon (or array of polygons) note: does not support dateline crossingstatic QueryInetAddressPoint. newPrefixQuery(String field, InetAddress value, int prefixLength)Create a prefix query for matching a CIDR network range.static QueryDoublePoint. newRangeQuery(String field, double[] lowerValue, double[] upperValue)Create a range query for n-dimensional double values.static QueryDoublePoint. newRangeQuery(String field, double lowerValue, double upperValue)Create a range query for double values.static QueryFloatPoint. newRangeQuery(String field, float[] lowerValue, float[] upperValue)Create a range query for n-dimensional float values.static QueryFloatPoint. newRangeQuery(String field, float lowerValue, float upperValue)Create a range query for float values.static QueryHalfFloatPoint. newRangeQuery(String field, float[] lowerValue, float[] upperValue)Create a range query for n-dimensional half-float values.static QueryHalfFloatPoint. newRangeQuery(String field, float lowerValue, float upperValue)Create a range query for half-float values.static QueryInetAddressPoint. newRangeQuery(String field, InetAddress lowerValue, InetAddress upperValue)Create a range query for network addresses.static QueryIntPoint. newRangeQuery(String field, int[] lowerValue, int[] upperValue)Create a range query for n-dimensional integer values.static QueryIntPoint. newRangeQuery(String field, int lowerValue, int upperValue)Create a range query for integer values.static QueryLongPoint. newRangeQuery(String field, long[] lowerValue, long[] upperValue)Create a range query for n-dimensional long values.static QueryLongPoint. newRangeQuery(String field, long lowerValue, long upperValue)Create a range query for long values.static QueryDoublePoint. newSetQuery(String field, double... values)Create a query matching any of the specified 1D values.static QueryDoublePoint. newSetQuery(String field, Collection<Double> values)Create a query matching any of the specified 1D values.static QueryFloatPoint. newSetQuery(String field, float... values)Create a query matching any of the specified 1D values.static QueryFloatPoint. newSetQuery(String field, Collection<Float> values)Create a query matching any of the specified 1D values.static QueryHalfFloatPoint. newSetQuery(String field, float... values)Create a query matching any of the specified 1D values.static QueryHalfFloatPoint. newSetQuery(String field, Collection<Float> values)Create a query matching any of the specified 1D values.static QueryInetAddressPoint. newSetQuery(String field, InetAddress... values)Create a query matching any of the specified 1D values.static QueryIntPoint. newSetQuery(String field, int... values)Create a query matching any of the specified 1D values.static QueryIntPoint. newSetQuery(String field, Collection<Integer> values)Create a query matching any of the specified 1D values.static QueryLongPoint. newSetQuery(String field, long... values)Create a query matching any of the specified 1D values.static QueryLongPoint. newSetQuery(String field, Collection<Long> values)Create a query matching any of the specified 1D values.static QueryLatLonDocValuesField. newSlowBoxQuery(String field, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude)Create a query for matching a bounding box using doc values.static QueryLatLonDocValuesField. newSlowDistanceQuery(String field, double latitude, double longitude, double radiusMeters)Create a query for matching points within the specified distance of the supplied location.static QueryNumericDocValuesField. newSlowExactQuery(String field, long value)Create a query for matching an exact long value.static QuerySortedDocValuesField. newSlowExactQuery(String field, BytesRef value)Create a query for matching an exactBytesRefvalue.static QuerySortedNumericDocValuesField. newSlowExactQuery(String field, long value)Create a query for matching an exact long value.static QuerySortedSetDocValuesField. newSlowExactQuery(String field, BytesRef value)Create a query for matching an exactBytesRefvalue.static QueryLatLonDocValuesField. newSlowPolygonQuery(String field, Polygon... polygons)Create a query for matching points within the supplied polygons.static QueryNumericDocValuesField. newSlowRangeQuery(String field, long lowerValue, long upperValue)Create a range query that matches all documents whose value is betweenlowerValueandupperValueincluded.static QuerySortedDocValuesField. newSlowRangeQuery(String field, BytesRef lowerValue, BytesRef upperValue, boolean lowerInclusive, boolean upperInclusive)Create a range query that matches all documents whose value is betweenlowerValueandupperValueincluded.static QuerySortedNumericDocValuesField. newSlowRangeQuery(String field, long lowerValue, long upperValue)Create a range query that matches all documents whose value is betweenlowerValueandupperValueincluded.static QuerySortedSetDocValuesField. newSlowRangeQuery(String field, BytesRef lowerValue, BytesRef upperValue, boolean lowerInclusive, boolean upperInclusive)Create a range query that matches all documents whose value is betweenlowerValueandupperValue.static QueryDoubleRange. newWithinQuery(String field, double[] min, double[] max)Create a query for matching indexed ranges that are within the defined range.static QueryFloatRange. newWithinQuery(String field, float[] min, float[] max)Create a query for matching indexed ranges that are within the defined range.static QueryInetAddressRange. newWithinQuery(String field, InetAddress min, InetAddress max)Create a query for matching indexed ip ranges that areWITHINthe defined range.static QueryIntRange. newWithinQuery(String field, int[] min, int[] max)Create a query for matching indexed ranges that are within the defined range.static QueryLongRange. newWithinQuery(String field, long[] min, long[] max)Create a query for matching indexed ranges that are within the defined range. -
Uses of Query in org.apache.lucene.index
Methods in org.apache.lucene.index with parameters of type Query Modifier and Type Method Description longIndexWriter. deleteDocuments(Query... queries)Deletes the document(s) matching any of the provided queries.Constructor parameters in org.apache.lucene.index with type arguments of type Query Constructor Description SoftDeletesRetentionMergePolicy(String field, Supplier<Query> retentionQuerySupplier, MergePolicy in)Creates a newSoftDeletesRetentionMergePolicy -
Uses of Query in org.apache.lucene.index.memory
Methods in org.apache.lucene.index.memory with parameters of type Query Modifier and Type Method Description floatMemoryIndex. search(Query query)Convenience method that efficiently returns the relevance score by matching this index against the given Lucene query expression. -
Uses of Query in org.apache.lucene.queries
Subclasses of Query in org.apache.lucene.queries Modifier and Type Class Description classBinaryDocValuesRangeQueryclassBlendedTermQueryBlendedTermQuery can be used to unify term statistics across one or more fields in the index.classCommonTermsQueryA query that executes high-frequency terms in a optional sub-query to prevent slow queries due to "common" terms like stopwords.classExtendedCommonTermsQueryDeprecated.Since max_optimization optimization landed in 7.0, normal MatchQuery will achieve the same result without any configuration.classMinDocQueryAQuerythat only matches documents that are greater than or equal to a configured doc ID.classSearchAfterSortedDocQueryclassSpanMatchNoDocsQueryASpanQuerythat matches no documents.Methods in org.apache.lucene.queries that return Query Modifier and Type Method Description protected QueryCommonTermsQuery. buildQuery(int maxDoc, TermStates[] contextArray, Term[] queryTerms)protected QueryCommonTermsQuery. newTermQuery(Term term, TermStates termStates)Builds a new TermQuery instance.QueryBlendedTermQuery. rewrite(IndexReader reader)QueryCommonTermsQuery. rewrite(IndexReader reader)QueryMinDocQuery. rewrite(IndexReader reader)protected abstract QueryBlendedTermQuery. topLevelQuery(Term[] terms, TermStates[] ctx, int[] docFreqs, int maxDoc) -
Uses of Query in org.apache.lucene.queries.function
Subclasses of Query in org.apache.lucene.queries.function Modifier and Type Class Description classFunctionScoreQueryA query that wraps another query, and uses a DoubleValuesSource to replace or modify the wrapped query's score If the DoubleValuesSource doesn't return a value for a particular document, then that document will be given a score of 0.Methods in org.apache.lucene.queries.function that return Query Modifier and Type Method Description QueryFunctionScoreQuery. getWrappedQuery()QueryFunctionScoreQuery. rewrite(IndexReader reader)Methods in org.apache.lucene.queries.function with parameters of type Query Modifier and Type Method Description static FunctionScoreQueryFunctionScoreQuery. boostByQuery(Query in, Query boostMatch, float boostValue)Returns a FunctionScoreQuery where the scores of a wrapped query are multiplied by a boost factor if the document being scored also matches a separate boosting query.static FunctionScoreQueryFunctionScoreQuery. boostByValue(Query in, DoubleValuesSource boost)Returns a FunctionScoreQuery where the scores of a wrapped query are multiplied by the value of a DoubleValuesSource.Constructors in org.apache.lucene.queries.function with parameters of type Query Constructor Description FunctionScoreQuery(Query in, DoubleValuesSource source)Create a new FunctionScoreQuery -
Uses of Query in org.apache.lucene.queries.intervals
Subclasses of Query in org.apache.lucene.queries.intervals Modifier and Type Class Description classIntervalQueryA query that retrieves documents containing intervals returned from anIntervalsSourceStatic constructor functions for various different sources can be found in theIntervalsclass Scores for this query are computed as a function of the sloppy frequency of intervals appearing in a particular document. -
Uses of Query in org.apache.lucene.queryparser.classic
Methods in org.apache.lucene.queryparser.classic that return Query Modifier and Type Method Description QueryQueryParser. Clause(String field)protected QueryQueryParserBase. getBooleanQuery(List<BooleanClause> clauses)Factory method for generating query, given a set of clauses.protected QueryQueryParserBase. getFieldQuery(String field, String queryText, boolean quoted)protected QueryQueryParserBase. getFieldQuery(String field, String queryText, int slop)Base implementation delegates toQueryParserBase.getFieldQuery(String,String,boolean).protected QueryQueryParserBase. getFuzzyQuery(String field, String termStr, float minSimilarity)Factory method for generating a query (similar toQueryParserBase.getWildcardQuery(java.lang.String, java.lang.String)).protected QueryQueryParserBase. getPrefixQuery(String field, String termStr)Factory method for generating a query (similar toQueryParserBase.getWildcardQuery(java.lang.String, java.lang.String)).protected QueryQueryParserBase. getRangeQuery(String field, String part1, String part2, boolean startInclusive, boolean endInclusive)protected QueryQueryParserBase. getRegexpQuery(String field, String termStr)Factory method for generating a query.protected QueryQueryParserBase. getWildcardQuery(String field, String termStr)Factory method for generating a query.protected QueryXQueryParser. handleBareFuzzy(String field, Token fuzzySlop, String termImage)QueryQueryParser. MultiTerm(String field, List<BooleanClause> clauses)Returns the first query if splitOnWhitespace=true or otherwise the entire produced queryprotected QueryQueryParserBase. newFieldQuery(Analyzer analyzer, String field, String queryText, boolean quoted)protected QueryQueryParserBase. newFuzzyQuery(Term term, float minimumSimilarity, int prefixLength)Builds a new FuzzyQuery instanceprotected QueryQueryParserBase. newMatchAllDocsQuery()Builds a new MatchAllDocsQuery instanceprotected QueryQueryParserBase. newPrefixQuery(Term prefix)Builds a new PrefixQuery instanceprotected QueryQueryParserBase. newRangeQuery(String field, String part1, String part2, boolean startInclusive, boolean endInclusive)Builds a newTermRangeQueryinstanceprotected QueryQueryParserBase. newRegexpQuery(Term regexp)Builds a new RegexpQuery instanceprotected QueryQueryParserBase. newWildcardQuery(Term t)Builds a new WildcardQuery instanceQueryQueryParserBase. parse(String query)Parses a query string, returning aQuery.QueryQueryParser. Query(String field)QueryQueryParser. Term(String field)QueryQueryParser. TopLevelQuery(String field)abstract QueryQueryParserBase. TopLevelQuery(String field)Methods in org.apache.lucene.queryparser.classic with parameters of type Query Modifier and Type Method Description protected voidQueryParserBase. addClause(List<BooleanClause> clauses, int conj, int mods, Query q)protected voidQueryParserBase. addMultiTermClauses(List<BooleanClause> clauses, Query q)Adds clauses generated from analysis over text containing whitespace.protected BooleanClauseQueryParserBase. newBooleanClause(Query q, BooleanClause.Occur occur)Builds a new BooleanClause instance -
Uses of Query in org.apache.lucene.queryparser.simple
Methods in org.apache.lucene.queryparser.simple that return Query Modifier and Type Method Description protected QuerySimpleQueryParser. newDefaultQuery(String text)Factory method to generate a standard query (no phrase or prefix operators).protected QuerySimpleQueryParser. newFuzzyQuery(String text, int fuzziness)Factory method to generate a fuzzy query.protected QuerySimpleQueryParser. newPhraseQuery(String text, int slop)Factory method to generate a phrase query with slop.protected QuerySimpleQueryParser. newPrefixQuery(String text)Factory method to generate a prefix query.QuerySimpleQueryParser. parse(String queryText)Parses the query text and returns parsed queryprotected QuerySimpleQueryParser. simplify(BooleanQuery bq)Helper to simplify boolean queries with 0 or 1 clause -
Uses of Query in org.apache.lucene.search
Subclasses of Query in org.apache.lucene.search Modifier and Type Class Description classAutomatonQueryAQuerythat will match terms against a finite-state machine.classBlendedTermQueryAQuerythat blends index statistics across multiple terms.classBooleanQueryA Query that matches documents matching boolean combinations of other queries, e.g.classBoostQueryAQuerywrapper that allows to give a boost to the wrapped query.classConstantScoreQueryA query that wraps another query and simply returns a constant score equal to 1 for every document that matches the query.classCoveringQueryAQuerythat allows to have a configurable number or required matches per document.classDisjunctionMaxQueryA 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.classDocValuesFieldExistsQueryAQuerythat matches documents that have a value for a given field as reported by doc values iterators.classFuzzyQueryImplements the fuzzy search query.classIndexOrDocValuesQueryA query that uses either an index structure (points or terms) or doc values in order to run a query, depending which one is more efficient.classMatchAllDocsQueryA query that matches all documents.classMatchNoDocsQueryA query that matches no documents.classMultiPhraseQueryA generalized version ofPhraseQuery, with the possibility of adding more than one term at the same position that are treated as a disjunction (OR).classMultiTermQueryAn abstractQuerythat matches documents containing a subset of terms provided by aFilteredTermsEnumenumeration.classNormsFieldExistsQueryAQuerythat matches documents that have a value for a given field as reported by field norms.classPhraseQueryA Query that matches documents containing a particular sequence of terms.classPointInSetQueryAbstract query class to find all documents whose single or multi-dimensional point values, previously indexed with e.g.classPointRangeQueryAbstract class for range queries against single or multidimensional points such asIntPoint.classPrefixQueryA Query that matches documents containing terms with a specified prefix.classRegexpQueryA fast regular expression query based on theorg.apache.lucene.util.automatonpackage.classSynonymQueryA query that treats multiple terms as synonyms.classTermInSetQuerySpecialization for a disjunction over many terms that behaves like aConstantScoreQueryover aBooleanQuerycontaining onlyBooleanClause.Occur.SHOULDclauses.classTermQueryA Query that matches documents containing a term.classTermRangeQueryA Query that matches documents within an range of terms.classWildcardQueryImplements the wildcard search query.Fields in org.apache.lucene.search declared as Query Modifier and Type Field Description protected QueryWeight. parentQueryMethods in org.apache.lucene.search that return Query Modifier and Type Method Description protected QueryMultiTermQuery.TopTermsBlendedFreqScoringRewrite. build(BlendedTermQuery.Builder builder)protected QueryMultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite. build(BooleanQuery.Builder builder)protected QueryMultiTermQuery.TopTermsScoringBooleanQueryRewrite. build(BooleanQuery.Builder builder)QueryIndexOrDocValuesQuery. getIndexQuery()Return the wrapped query that may be costly to initialize but has a good iterator.QueryBooleanClause. getQuery()QueryBoostQuery. getQuery()Return the wrappedQuery.QueryConstantScoreQuery. getQuery()Returns the encapsulated query.QueryFilterMatchesIterator. getQuery()QueryMatchesIterator. getQuery()Returns the Query causing the current match If thisMatchesIteratorhas been returned from aMatchesIterator.getSubMatches()call, then returns aTermQueryequivalent to the current match Should only be called afterMatchesIterator.next()has returnedtrueQueryWeight. getQuery()The query that this concerns.QueryIndexOrDocValuesQuery. getRandomAccessQuery()Return the wrapped query that may be slow at identifying all matching documents, but which is cheap to initialize and can efficiently verify that some documents match.QueryBlendedTermQuery.DisjunctionMaxRewrite. rewrite(Query[] subQueries)QueryBlendedTermQuery. rewrite(IndexReader reader)abstract QueryBlendedTermQuery.RewriteMethod. rewrite(Query[] subQueries)Merge the provided sub queries into a singleQueryobject.QueryBooleanQuery. rewrite(IndexReader reader)QueryBoostQuery. rewrite(IndexReader reader)QueryConstantScoreQuery. rewrite(IndexReader reader)QueryCoveringQuery. rewrite(IndexReader reader)QueryDisjunctionMaxQuery. rewrite(IndexReader reader)Optimize our representation and our subqueries representationsQueryIndexOrDocValuesQuery. rewrite(IndexReader reader)QueryIndexSearcher. rewrite(Query original)Expert: called to re-write queries into primitive queries.QueryMultiPhraseQuery. rewrite(IndexReader reader)QueryMultiTermQuery. rewrite(IndexReader reader)To rewrite to a simpler form, instead return a simpler enum fromMultiTermQuery.getTermsEnum(Terms, AttributeSource).abstract QueryMultiTermQuery.RewriteMethod. rewrite(IndexReader reader, MultiTermQuery query)QueryPhraseQuery. rewrite(IndexReader reader)QueryQuery. rewrite(IndexReader reader)Expert: called to re-write queries into primitive queries.QueryScoringRewrite. rewrite(IndexReader reader, MultiTermQuery query)QuerySynonymQuery. rewrite(IndexReader reader)QueryTermInSetQuery. rewrite(IndexReader reader)QueryTopTermsRewrite. rewrite(IndexReader reader, MultiTermQuery query)Methods in org.apache.lucene.search that return types with arguments of type Query Modifier and Type Method Description List<Query>DisjunctionMaxQuery. getDisjuncts()Iterator<Query>DisjunctionMaxQuery. iterator()Methods in org.apache.lucene.search with parameters of type Query Modifier and Type Method Description BooleanQuery.BuilderBooleanQuery.Builder. add(Query query, BooleanClause.Occur occur)Add a new clause to thisBooleanQuery.Builder.voidLRUQueryCache. clearQuery(Query query)Remove all cache entries for the given query.voidQueryVisitor. consumeTerms(Query query, Term... terms)Called by leaf queries that match on specific termsvoidQueryVisitor. consumeTermsMatching(Query query, String field, ByteRunAutomaton automaton)Called by leaf queries that match on a class of termsintIndexSearcher. count(Query query)Count how many documents match the given query.WeightIndexSearcher. createWeight(Query query, ScoreMode scoreMode, float boost)Creates aWeightfor the given query, potentially adding caching if possible and configured.static MatchesIteratorMatchesUtils. disjunction(LeafReaderContext context, int doc, Query query, String field, BytesRefIterator terms)Create a MatchesIterator that is a disjunction over a list of terms extracted from aBytesRefIterator.ExplanationIndexSearcher. explain(Query query, int doc)Returns an Explanation that describes howdocscored againstquery.static DoubleValuesSourceDoubleValuesSource. fromQuery(Query query)Create a DoubleValuesSource that returns the score of a particular queryQueryVisitorQueryVisitor. getSubVisitor(BooleanClause.Occur occur, Query parent)Pulls a visitor instance for visiting child clauses of a query The default implementation returnsthis, unlessoccuris equal toBooleanClause.Occur.MUST_NOTin which case it returnsQueryVisitor.EMPTY_VISITORprotected intUsageTrackingQueryCachingPolicy. minFrequencyToCache(Query query)For a given filter, return how many times it should appear in the history before being cached.protected voidLRUQueryCache. onHit(Object readerCoreKey, Query query)Expert: callback when there is a cache hit on a given query.protected voidLRUQueryCache. onMiss(Object readerCoreKey, Query query)Expert: callback when there is a cache miss on a given query.protected voidLRUQueryCache. onQueryCache(Query query, long ramBytesUsed)Expert: callback when a query is added to this cache.protected voidLRUQueryCache. onQueryEviction(Query query, long ramBytesUsed)Expert: callback when a query is evicted from this cache.voidQueryCachingPolicy. onUse(Query query)Callback that is called every time that a cached filter is used.voidUsageTrackingQueryCachingPolicy. onUse(Query query)static voidTopFieldCollector. populateScores(ScoreDoc[] topDocs, IndexSearcher searcher, Query query)Populatescoresof the giventopDocs.static TopDocsQueryRescorer. rescore(IndexSearcher searcher, TopDocs topDocs, Query query, double weight, int topN)Sugar API, calling {#rescore} using a simple linear combination of firstPassScore + weight * secondPassScoreQueryBlendedTermQuery.DisjunctionMaxRewrite. rewrite(Query[] subQueries)abstract QueryBlendedTermQuery.RewriteMethod. rewrite(Query[] subQueries)Merge the provided sub queries into a singleQueryobject.QueryIndexSearcher. rewrite(Query original)Expert: called to re-write queries into primitive queries.TopDocsIndexSearcher. search(Query query, int n)Finds the topnhits forquery.TopFieldDocsIndexSearcher. search(Query query, int n, Sort sort)Search implementation with arbitrary sorting.TopFieldDocsIndexSearcher. search(Query query, int n, Sort sort, boolean doDocScores)Search implementation with arbitrary sorting, plus control over whether hit scores and max score should be computed.voidIndexSearcher. search(Query query, Collector results)Lower-level search API.<C extends Collector,T>
TIndexSearcher. search(Query query, CollectorManager<C,T> collectorManager)Lower-level search API.TopDocsIndexSearcher. searchAfter(ScoreDoc after, Query query, int numHits)Finds the topnhits forquerywhere all results are after a previous result (after).TopDocsIndexSearcher. searchAfter(ScoreDoc after, Query query, int n, Sort sort)Finds the topnhits forquerywhere all results are after a previous result (after).TopFieldDocsIndexSearcher. searchAfter(ScoreDoc after, Query query, int numHits, Sort sort, boolean doDocScores)Finds the topnhits forquerywhere all results are after a previous result (after), allowing control over whether hit scores and max score should be computed.booleanQueryCachingPolicy. shouldCache(Query query)Whether the givenQueryis worth caching.booleanUsageTrackingQueryCachingPolicy. shouldCache(Query query)voidQueryVisitor. visitLeaf(Query query)Called by leaf queries that do not match on termsConstructors in org.apache.lucene.search with parameters of type Query Constructor Description BooleanClause(Query query, BooleanClause.Occur occur)Constructs a BooleanClause.BoostQuery(Query query, float boost)Sole constructor: wrapqueryin such a way that the produced scores will be boosted byboost.ConstantScoreQuery(Query query)Strips off scores from the passed in Query.ConstantScoreWeight(Query query, float score)FilterWeight(Query query, Weight weight)Alternative constructor.IndexOrDocValuesQuery(Query indexQuery, Query dvQuery)Create anIndexOrDocValuesQuery.QueryRescorer(Query query)Sole constructor, passing the 2nd pass query to assign scores to the 1st pass hits.Weight(Query query)Sole constructor, typically invoked by sub-classes.Constructor parameters in org.apache.lucene.search with type arguments of type Query Constructor Description CoveringQuery(Collection<Query> queries, LongValuesSource minimumNumberMatch)Sole constructor.DisjunctionMaxQuery(Collection<Query> disjuncts, float tieBreakerMultiplier)Creates a new DisjunctionMaxQuery -
Uses of Query in org.apache.lucene.search.highlight
Methods in org.apache.lucene.search.highlight with parameters of type Query Modifier and Type Method Description protected voidWeightedSpanTermExtractor. extract(Query query, float boost, Map<String,WeightedSpanTerm> terms)protected voidWeightedSpanTermExtractor. extractUnknownQuery(Query query, Map<String,WeightedSpanTerm> terms)protected voidWeightedSpanTermExtractor. extractWeightedTerms(Map<String,WeightedSpanTerm> terms, Query query, float boost)Map<String,WeightedSpanTerm>WeightedSpanTermExtractor. getWeightedSpanTerms(Query query, float boost, TokenStream tokenStream)Creates a Map ofWeightedSpanTermsfrom the givenQueryandTokenStream.Map<String,WeightedSpanTerm>WeightedSpanTermExtractor. getWeightedSpanTerms(Query query, float boost, TokenStream tokenStream, String fieldName)Creates a Map ofWeightedSpanTermsfrom the givenQueryandTokenStream.Map<String,WeightedSpanTerm>WeightedSpanTermExtractor. getWeightedSpanTermsWithScores(Query query, float boost, TokenStream tokenStream, String fieldName, IndexReader reader)Creates a Map ofWeightedSpanTermsfrom the givenQueryandTokenStream.Method parameters in org.apache.lucene.search.highlight with type arguments of type Query Modifier and Type Method Description protected booleanWeightedSpanTermExtractor. isQueryUnsupported(Class<? extends Query> clazz)Constructors in org.apache.lucene.search.highlight with parameters of type Query Constructor Description QueryScorer(Query query)QueryScorer(Query query, String field)QueryScorer(Query query, String field, String defaultField)QueryScorer(Query query, IndexReader reader, String field)QueryScorer(Query query, IndexReader reader, String field, String defaultField) -
Uses of Query in org.apache.lucene.search.join
Subclasses of Query in org.apache.lucene.search.join Modifier and Type Class Description classParentChildrenBlockJoinQueryA query that returns all the matching child documents for a specific parent document indexed together in the same block.classToChildBlockJoinQueryJust likeToParentBlockJoinQuery, except this query joins in reverse: you provide a Query matching parent documents and it joins down to child documents.classToParentBlockJoinQueryThis query requires that you index children and parent docs as a single block, using theIndexWriter.addDocuments()orIndexWriter.updateDocuments()API.Methods in org.apache.lucene.search.join that return Query Modifier and Type Method Description QueryToParentBlockJoinQuery. getChildQuery()Return our child query.QueryToChildBlockJoinQuery. getParentQuery()Return our parent query.QueryParentChildrenBlockJoinQuery. rewrite(IndexReader reader)QueryToChildBlockJoinQuery. rewrite(IndexReader reader)QueryToParentBlockJoinQuery. rewrite(IndexReader reader)Constructors in org.apache.lucene.search.join with parameters of type Query Constructor Description ParentChildrenBlockJoinQuery(BitSetProducer parentFilter, Query childQuery, int parentDocId)Creates aParentChildrenBlockJoinQueryinstanceToChildBlockJoinQuery(Query parentQuery, BitSetProducer parentsFilter)Create a ToChildBlockJoinQuery.ToParentBlockJoinQuery(Query childQuery, BitSetProducer parentsFilter, ScoreMode scoreMode)Create a ToParentBlockJoinQuery. -
Uses of Query in org.apache.lucene.search.spans
Subclasses of Query in org.apache.lucene.search.spans Modifier and Type Class Description classFieldMaskingSpanQueryWrapper to allowSpanQueryobjects participate in composite single-field SpanQueries by 'lying' about their search field.classSpanBoostQueryCounterpart ofBoostQueryfor spans.classSpanContainingQueryKeep matches that contain another SpanScorer.classSpanFirstQueryMatches spans near the beginning of a field.classSpanMultiTermQueryWrapper<Q extends MultiTermQuery>Wraps anyMultiTermQueryas aSpanQuery, so it can be nested within other SpanQuery classes.classSpanNearQueryMatches spans which are near one another.classSpanNotQueryRemoves matches which overlap with another SpanQuery or which are within x tokens before or y tokens after another SpanQuery.classSpanOrQueryMatches the union of its clauses.classSpanPositionCheckQueryBase class for filtering a SpanQuery based on the position of a match.classSpanPositionRangeQueryChecks to see if theSpanPositionCheckQuery.getMatch()lies between a start and end position SeeSpanFirstQueryfor a derivation that is optimized for the case where start position is 0.classSpanQueryBase class for span-based queries.classSpanTermQueryMatches spans containing a term.classSpanWithinQueryKeep matches that are contained within another Spans.Methods in org.apache.lucene.search.spans that return Query Modifier and Type Method Description QuerySpanMultiTermQueryWrapper. getWrappedQuery()Returns the wrapped queryQueryFieldMaskingSpanQuery. rewrite(IndexReader reader)QuerySpanBoostQuery. rewrite(IndexReader reader)QuerySpanMultiTermQueryWrapper. rewrite(IndexReader reader)QuerySpanNearQuery. rewrite(IndexReader reader)QuerySpanNotQuery. rewrite(IndexReader reader)QuerySpanOrQuery. rewrite(IndexReader reader)QuerySpanPositionCheckQuery. rewrite(IndexReader reader) -
Uses of Query in org.apache.lucene.search.suggest.document
Subclasses of Query in org.apache.lucene.search.suggest.document Modifier and Type Class Description classCompletionQueryAbstractQuerythat match documents containing terms with a specified prefix filtered byBitsProducer.classContextQueryACompletionQuerythat matches documents specified by a wrappedCompletionQuerysupporting boosting and/or filtering by specified contexts.classFuzzyCompletionQueryACompletionQuerythat match documents containing terms within an edit distance of the specified prefix.classPrefixCompletionQueryACompletionQuerywhich takes anAnalyzerto analyze the prefix of the query term.classRegexCompletionQueryACompletionQuerywhich takes a regular expression as the prefix of the query term.Methods in org.apache.lucene.search.suggest.document that return Query Modifier and Type Method Description QueryCompletionQuery. rewrite(IndexReader reader) -
Uses of Query in org.apache.lucene.search.uhighlight
Methods in org.apache.lucene.search.uhighlight that return Query Modifier and Type Method Description QueryUHComponents. getQuery()Methods in org.apache.lucene.search.uhighlight that return types with arguments of type Query Modifier and Type Method Description protected Collection<Query>CustomUnifiedHighlighter. preSpanQueryRewrite(Query query)protected Collection<Query>UnifiedHighlighter. preSpanQueryRewrite(Query query)When highlighting phrases accurately, we may need to handle custom queries that aren't supported in theWeightedSpanTermExtractoras called by thePhraseHelper.Methods in org.apache.lucene.search.uhighlight with parameters of type Query Modifier and Type Method Description protected static Set<Term>UnifiedHighlighter. extractTerms(Query query)Extracts matching terms after rewriting against an empty indexprotected LabelledCharArrayMatcher[]UnifiedHighlighter. getAutomata(String field, Query query, Set<UnifiedHighlighter.HighlightFlag> highlightFlags)protected FieldHighlighterCustomUnifiedHighlighter. getFieldHighlighter(String field, Query query, Set<Term> allTerms, int maxPassages)protected FieldHighlighterUnifiedHighlighter. getFieldHighlighter(String field, Query query, Set<Term> allTerms, int maxPassages)protected UHComponentsUnifiedHighlighter. getHighlightComponents(String field, Query query, Set<Term> allTerms)protected PhraseHelperUnifiedHighlighter. getPhraseHelper(String field, Query query, Set<UnifiedHighlighter.HighlightFlag> highlightFlags)protected booleanUnifiedHighlighter. hasUnrecognizedQuery(Predicate<String> fieldMatcher, Query query)String[]UnifiedHighlighter. highlight(String field, Query query, TopDocs topDocs)Highlights the top passages from a single field.String[]UnifiedHighlighter. highlight(String field, Query query, TopDocs topDocs, int maxPassages)Highlights the top-N passages from a single field.Snippet[]CustomUnifiedHighlighter. highlightField(String field, Query query, int docId, int maxPassages)Highlights terms extracted from the provided query within the content of the provided field nameMap<String,String[]>UnifiedHighlighter. highlightFields(String[] fieldsIn, Query query, int[] docidsIn, int[] maxPassagesIn)Highlights the top-N passages from multiple fields, for the provided int[] docids.Map<String,String[]>UnifiedHighlighter. highlightFields(String[] fields, Query query, TopDocs topDocs)Highlights the top passages from multiple fields.Map<String,String[]>UnifiedHighlighter. highlightFields(String[] fields, Query query, TopDocs topDocs, int[] maxPassages)Highlights the top-N passages from multiple fields.protected Map<String,Object[]>UnifiedHighlighter. highlightFieldsAsObjects(String[] fieldsIn, Query query, int[] docIdsIn, int[] maxPassagesIn)Expert: highlights the top-N passages from multiple fields, for the provided int[] docids, to custom Object as returned by thePassageFormatter.ObjectUnifiedHighlighter. highlightWithoutSearcher(String field, Query query, String content, int maxPassages)Highlights text passed as a parameter.protected Collection<Query>CustomUnifiedHighlighter. preSpanQueryRewrite(Query query)protected Collection<Query>UnifiedHighlighter. preSpanQueryRewrite(Query query)When highlighting phrases accurately, we may need to handle custom queries that aren't supported in theWeightedSpanTermExtractoras called by thePhraseHelper.Constructors in org.apache.lucene.search.uhighlight with parameters of type Query Constructor Description PhraseHelper(Query query, String field, Predicate<String> fieldMatcher, Function<SpanQuery,Boolean> rewriteQueryPred, Function<Query,Collection<Query>> preExtractRewriteFunction, boolean ignoreQueriesNeedingRewrite)Constructor.UHComponents(String field, Predicate<String> fieldMatcher, Query query, BytesRef[] terms, PhraseHelper phraseHelper, LabelledCharArrayMatcher[] automata, boolean hasUnrecognizedQueryPart, Set<UnifiedHighlighter.HighlightFlag> highlightFlags) -
Uses of Query in org.apache.lucene.search.vectorhighlight
Methods in org.apache.lucene.search.vectorhighlight with parameters of type Query Modifier and Type Method Description protected voidCustomFieldQuery. flatten(Query sourceQuery, IndexReader reader, Collection<Query> flatQueries, float boost)protected voidFieldQuery. flatten(Query sourceQuery, IndexReader reader, Collection<Query> flatQueries, float boost)FieldQueryFastVectorHighlighter. getFieldQuery(Query query)create aFieldQueryobject.FieldQueryFastVectorHighlighter. getFieldQuery(Query query, IndexReader reader)create aFieldQueryobject.Method parameters in org.apache.lucene.search.vectorhighlight with type arguments of type Query Modifier and Type Method Description protected voidCustomFieldQuery. flatten(Query sourceQuery, IndexReader reader, Collection<Query> flatQueries, float boost)protected voidFieldQuery. flatten(Query sourceQuery, IndexReader reader, Collection<Query> flatQueries, float boost)Constructors in org.apache.lucene.search.vectorhighlight with parameters of type Query Constructor Description CustomFieldQuery(Query query, IndexReader reader, boolean phraseHighlight, boolean fieldMatch)CustomFieldQuery(Query query, IndexReader reader, FastVectorHighlighter highlighter)FieldQuery(Query query, IndexReader reader, boolean phraseHighlight, boolean fieldMatch) -
Uses of Query in org.apache.lucene.spatial
Methods in org.apache.lucene.spatial that return Query Modifier and Type Method Description abstract QuerySpatialStrategy. makeQuery(SpatialArgs args) -
Uses of Query in org.apache.lucene.spatial.prefix
Subclasses of Query in org.apache.lucene.spatial.prefix Modifier and Type Class Description classAbstractPrefixTreeQueryBase class for Lucene Queries on SpatialPrefixTree fields.classAbstractVisitingPrefixTreeQueryTraverses aSpatialPrefixTreeindexed field, using the template and visitor design patterns for subclasses to guide the traversal and collect matching documents.classContainsPrefixTreeQueryFinds docs where its indexed shapeCONTAINSthe query shape.classIntersectsPrefixTreeQueryA Query matching documents that have anSpatialRelation.INTERSECTS(i.e.classWithinPrefixTreeQueryFinds docs where its indexed shape isWITHINthe query shape.Methods in org.apache.lucene.spatial.prefix that return Query Modifier and Type Method Description protected QueryRecursivePrefixTreeStrategy. makeGridShapeIntersectsQuery(Shape gridShape)RecursivePrefixTreeStrategy.makeQuery(SpatialArgs)specialized for the query being a grid square.QueryRecursivePrefixTreeStrategy. makeQuery(SpatialArgs args)QueryTermQueryPrefixTreeStrategy. makeQuery(SpatialArgs args) -
Uses of Query in org.apache.lucene.util
Methods in org.apache.lucene.util that return Query Modifier and Type Method Description protected QueryQueryBuilder. analyzeBoolean(String field, TokenStream stream)Creates simple boolean query from the cached tokenstream contentsprotected QueryQueryBuilder. analyzeGraphBoolean(String field, TokenStream source, BooleanClause.Occur operator)Creates a boolean query from a graph token stream.protected QueryQueryBuilder. analyzeGraphPhrase(TokenStream source, String field, int phraseSlop)Creates graph phrase query from the tokenstream contentsprotected QueryQueryBuilder. analyzeMultiBoolean(String field, TokenStream stream, BooleanClause.Occur operator)Creates complex boolean query from the cached tokenstream contentsprotected QueryQueryBuilder. analyzeMultiPhrase(String field, TokenStream stream, int slop)Creates complex phrase query from the cached tokenstream contentsprotected QueryQueryBuilder. analyzePhrase(String field, TokenStream stream, int slop)Creates simple phrase query from the cached tokenstream contentsprotected QueryQueryBuilder. analyzeTerm(String field, TokenStream stream)Creates simple term query from the cached tokenstream contentsQueryQueryBuilder. createBooleanQuery(String field, String queryText)Creates a boolean query from the query text.QueryQueryBuilder. createBooleanQuery(String field, String queryText, BooleanClause.Occur operator)Creates a boolean query from the query text.protected QueryQueryBuilder. createFieldQuery(Analyzer analyzer, BooleanClause.Occur operator, String field, String queryText, boolean quoted, int phraseSlop)Creates a query from the analysis chain.protected QueryQueryBuilder. createFieldQuery(TokenStream source, BooleanClause.Occur operator, String field, boolean quoted, int phraseSlop)Creates a query from a token stream.QueryQueryBuilder. createMinShouldMatchQuery(String field, String queryText, float fraction)Creates a minimum-should-match query from the query text.QueryQueryBuilder. createPhraseQuery(String field, String queryText)Creates a phrase query from the query text.QueryQueryBuilder. createPhraseQuery(String field, String queryText, int phraseSlop)Creates a phrase query from the query text.protected QueryQueryBuilder. newGraphSynonymQuery(Iterator<Query> queries)Builds a new GraphQuery for multi-terms synonyms.protected QueryQueryBuilder. newSynonymQuery(Term[] terms)Builds a new SynonymQuery instance.protected QueryQueryBuilder. newTermQuery(Term term)Builds a new TermQuery instance.Methods in org.apache.lucene.util with parameters of type Query Modifier and Type Method Description static longRamUsageEstimator. sizeOf(Query q)Returns the size in bytes of a Query object.static longRamUsageEstimator. sizeOf(Query q, long defSize)Returns the size in bytes of a Query object.Method parameters in org.apache.lucene.util with type arguments of type Query Modifier and Type Method Description protected QueryQueryBuilder. newGraphSynonymQuery(Iterator<Query> queries)Builds a new GraphQuery for multi-terms synonyms. -
Uses of Query in org.apache.lucene.util.automaton
Methods in org.apache.lucene.util.automaton with parameters of type Query Modifier and Type Method Description voidCompiledAutomaton. visit(QueryVisitor visitor, Query parent, String field)Report back to a QueryVisitor how this automaton matches terms -
Uses of Query in org.elasticsearch.common.lucene
Methods in org.elasticsearch.common.lucene with parameters of type Query Modifier and Type Method Description static booleanLucene. exists(IndexSearcher searcher, Query query)Check whether there is one or more documents matching the provided query. -
Uses of Query in org.elasticsearch.common.lucene.index
Constructors in org.elasticsearch.common.lucene.index with parameters of type Query Constructor Description FilterableTermsEnum(IndexReader reader, String field, int docsEnumFlag, Query filter)FreqTermsEnum(IndexReader reader, String field, boolean needDocFreq, boolean needTotalTermFreq, Query filter, BigArrays bigArrays) -
Uses of Query in org.elasticsearch.common.lucene.search
Subclasses of Query in org.elasticsearch.common.lucene.search Modifier and Type Class Description classMoreLikeThisQueryclassMultiPhrasePrefixQueryMethods in org.elasticsearch.common.lucene.search that return Query Modifier and Type Method Description static QueryQueries. applyMinimumShouldMatch(BooleanQuery query, String minimumShouldMatch)static QueryQueries. fixNegativeQueryIfNeeded(Query q)QueryXMoreLikeThis. like(int docNum)Return a query that will return docs like the passed lucene document ID.QueryXMoreLikeThis. like(String fieldName, Reader... readers)Return a query that will return docs like the passed Readers.QueryXMoreLikeThis. like(Fields... likeFields)Return a query that will return docs like the passed Fields.QueryXMoreLikeThis. like(Terms... likeTerms)Return a query that will return docs like the passed Terms.static QueryQueries. maybeApplyMinimumShouldMatch(Query query, String minimumShouldMatch)Potentially apply minimum should match value if we have a query that it can be applied to, otherwise return the original query.static QueryQueries. newLenientFieldQuery(String field, RuntimeException e)static QueryQueries. newMatchAllQuery()static QueryQueries. newMatchNoDocsQuery(String reason)Return a query that matches no document.static QueryQueries. newNestedFilter()static QueryQueries. newNonNestedFilter(Version indexVersionCreated)Creates a new non-nested docs querystatic QueryQueries. newUnmappedFieldQuery(String field)static QueryQueries. newUnmappedFieldsQuery(Collection<String> fields)static QueryQueries. not(Query q)Return a query that matches all documents but those that match the given query.QueryMoreLikeThisQuery. rewrite(IndexReader reader)QueryMultiPhrasePrefixQuery. rewrite(IndexReader reader)Methods in org.elasticsearch.common.lucene.search with parameters of type Query Modifier and Type Method Description static BooleanQueryQueries. filtered(Query query, Query filter)static QueryQueries. fixNegativeQueryIfNeeded(Query q)static QueryQueries. maybeApplyMinimumShouldMatch(Query query, String minimumShouldMatch)Potentially apply minimum should match value if we have a query that it can be applied to, otherwise return the original query.static QueryQueries. not(Query q)Return a query that matches all documents but those that match the given query. -
Uses of Query in org.elasticsearch.common.lucene.search.function
Subclasses of Query in org.elasticsearch.common.lucene.search.function Modifier and Type Class Description classFunctionScoreQueryA query that allows for a pluggable boost function / filter.classScriptScoreQueryA query that uses a script to compute documents' scores.Fields in org.elasticsearch.common.lucene.search.function declared as Query Modifier and Type Field Description QueryFunctionScoreQuery.FilterScoreFunction. filterMethods in org.elasticsearch.common.lucene.search.function that return Query Modifier and Type Method Description QueryFunctionScoreQuery. getSubQuery()QueryFunctionScoreQuery. rewrite(IndexReader reader)QueryScriptScoreQuery. rewrite(IndexReader reader)Constructors in org.elasticsearch.common.lucene.search.function with parameters of type Query Constructor Description FilterScoreFunction(Query filter, ScoreFunction function)FunctionScoreQuery(Query subQuery, Float minScore, float maxBoost)Creates a FunctionScoreQuery without function.FunctionScoreQuery(Query subQuery, FunctionScoreQuery.ScoreMode scoreMode, ScoreFunction[] functions, CombineFunction combineFunction, Float minScore, float maxBoost)Creates a FunctionScoreQuery with multiple score functionsFunctionScoreQuery(Query subQuery, ScoreFunction function)Creates a FunctionScoreQuery with a singleScoreFunctionFunctionScoreQuery(Query subQuery, ScoreFunction function, CombineFunction combineFunction, Float minScore, float maxBoost)Creates a FunctionScoreQuery with a single functionScriptScoreQuery(Query subQuery, Script script, ScoreScript.LeafFactory scriptBuilder, Float minScore, String indexName, int shardId, Version indexVersion) -
Uses of Query in org.elasticsearch.index.cache.bitset
Methods in org.elasticsearch.index.cache.bitset with parameters of type Query Modifier and Type Method Description static BitSetBitsetFilterCache. bitsetFromQuery(Query query, LeafReaderContext context)BitSetProducerBitsetFilterCache. getBitSetProducer(Query query)Method parameters in org.elasticsearch.index.cache.bitset with type arguments of type Query Modifier and Type Method Description voidBitsetFilterCache. onRemoval(RemovalNotification<IndexReader.CacheKey,Cache<Query,BitsetFilterCache.Value>> notification) -
Uses of Query in org.elasticsearch.index.fielddata
Methods in org.elasticsearch.index.fielddata that return Query Modifier and Type Method Description QueryIndexFieldData.XFieldComparatorSource.Nested. getInnerQuery()Constructors in org.elasticsearch.index.fielddata with parameters of type Query Constructor Description Nested(BitSetProducer rootFilter, Query innerQuery, NestedSortBuilder nestedSort, IndexSearcher searcher) -
Uses of Query in org.elasticsearch.index.mapper
Subclasses of Query in org.elasticsearch.index.mapper Modifier and Type Class Description static classTypeFieldMapper.TypesQuerySpecialization for a disjunction over many _typeMethods in org.elasticsearch.index.mapper that return Query Modifier and Type Method Description abstract QueryRangeType. containsQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)static QueryTextFieldMapper. createPhrasePrefixQuery(TokenStream stream, String field, int slop, int maxExpansions, String prefixField, IntPredicate usePrefixField)static QueryTextFieldMapper. createPhraseQuery(TokenStream stream, String field, int slop, boolean enablePositionIncrements)abstract QueryRangeType. dvRangeQuery(String field, BinaryDocValuesRangeQuery.QueryType queryType, Object from, Object to, boolean includeFrom, boolean includeTo)QueryAbstractGeometryFieldMapper.AbstractGeometryFieldType. existsQuery(QueryShardContext context)QueryBooleanFieldMapper.BooleanFieldType. existsQuery(QueryShardContext context)QueryCompletionFieldMapper.CompletionFieldType. existsQuery(QueryShardContext context)QueryDateFieldMapper.DateFieldType. existsQuery(QueryShardContext context)QueryFieldNamesFieldMapper.FieldNamesFieldType. existsQuery(QueryShardContext context)QueryGeoPointFieldMapper.GeoPointFieldType. existsQuery(QueryShardContext context)QueryIgnoredFieldMapper.IgnoredFieldType. existsQuery(QueryShardContext context)QueryIpFieldMapper.IpFieldType. existsQuery(QueryShardContext context)QueryKeywordFieldMapper.KeywordFieldType. existsQuery(QueryShardContext context)abstract QueryMappedFieldType. existsQuery(QueryShardContext context)QueryNumberFieldMapper.NumberFieldType. existsQuery(QueryShardContext context)QueryRangeFieldMapper.RangeFieldType. existsQuery(QueryShardContext context)QueryTextFieldMapper.TextFieldType. existsQuery(QueryShardContext context)QueryTypeFieldMapper.TypeFieldType. existsQuery(QueryShardContext context)QueryMappedFieldType. fuzzyQuery(Object value, Fuzziness fuzziness, int prefixLength, int maxExpansions, boolean transpositions)QueryStringFieldType. fuzzyQuery(Object value, Fuzziness fuzziness, int prefixLength, int maxExpansions, boolean transpositions)abstract QueryRangeType. intersectsQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)QueryMappedFieldType. multiPhraseQuery(TokenStream stream, int slop, boolean enablePositionIncrements)QueryTextFieldMapper.TextFieldType. multiPhraseQuery(TokenStream stream, int slop, boolean enablePositionIncrements)QueryObjectMapper. nestedTypeFilter()QueryMappedFieldType. phrasePrefixQuery(TokenStream stream, int slop, int maxExpansions)QueryTextFieldMapper.TextFieldType. phrasePrefixQuery(TokenStream stream, int slop, int maxExpansions)QueryMappedFieldType. phraseQuery(TokenStream stream, int slop, boolean enablePositionIncrements)QueryTextFieldMapper.TextFieldType. phraseQuery(TokenStream stream, int slop, boolean enablePosIncrements)QueryMappedFieldType. prefixQuery(String value, MultiTermQuery.RewriteMethod method, QueryShardContext context)QueryStringFieldType. prefixQuery(String value, MultiTermQuery.RewriteMethod method, QueryShardContext context)QueryTextFieldMapper.TextFieldType. prefixQuery(String value, MultiTermQuery.RewriteMethod method, QueryShardContext context)QueryAbstractGeometryFieldMapper.QueryProcessor. process(Geometry shape, String fieldName, ShapeRelation relation, QueryShardContext context)default QueryAbstractGeometryFieldMapper.QueryProcessor. process(Geometry shape, String fieldName, SpatialStrategy strategy, ShapeRelation relation, QueryShardContext context)Deprecated.QueryBooleanFieldMapper.BooleanFieldType. rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, QueryShardContext context)QueryDateFieldMapper.DateFieldType. rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, ShapeRelation relation, ZoneId timeZone, DateMathParser forcedDateParser, QueryShardContext context)QueryIpFieldMapper.IpFieldType. rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, QueryShardContext context)QueryMappedFieldType. rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, ShapeRelation relation, ZoneId timeZone, DateMathParser parser, QueryShardContext context)Factory method for range queries.QueryNumberFieldMapper.NumberFieldType. rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, QueryShardContext context)abstract QueryNumberFieldMapper.NumberType. rangeQuery(String field, Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, boolean hasDocValues)QueryRangeFieldMapper.RangeFieldType. rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, ShapeRelation relation, ZoneId timeZone, DateMathParser parser, QueryShardContext context)QueryRangeType. rangeQuery(String field, boolean hasDocValues, Object from, Object to, boolean includeFrom, boolean includeTo, ShapeRelation relation, ZoneId timeZone, DateMathParser dateMathParser, QueryShardContext context)QuerySimpleMappedFieldType. rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, ShapeRelation relation, ZoneId timeZone, DateMathParser parser, QueryShardContext context)protected QuerySimpleMappedFieldType. rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, QueryShardContext context)Same asSimpleMappedFieldType.rangeQuery(Object, Object, boolean, boolean, ShapeRelation, ZoneId, DateMathParser, QueryShardContext)but without the trouble of relations or date-specific options.QueryStringFieldType. rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, QueryShardContext context)QueryTypeFieldMapper.TypeFieldType. rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, QueryShardContext context)QueryMappedFieldType. regexpQuery(String value, int flags, int maxDeterminizedStates, MultiTermQuery.RewriteMethod method, QueryShardContext context)QueryStringFieldType. regexpQuery(String value, int flags, int maxDeterminizedStates, MultiTermQuery.RewriteMethod method, QueryShardContext context)QueryTypeFieldMapper.TypesQuery. rewrite(IndexReader reader)QueryAbstractGeometryFieldMapper.AbstractGeometryFieldType. termQuery(Object value, QueryShardContext context)QueryDateFieldMapper.DateFieldType. termQuery(Object value, QueryShardContext context)QueryFieldNamesFieldMapper.FieldNamesFieldType. termQuery(Object value, QueryShardContext context)QueryGeoPointFieldMapper.GeoPointFieldType. termQuery(Object value, QueryShardContext context)QueryIpFieldMapper.IpFieldType. termQuery(Object value, QueryShardContext context)abstract QueryMappedFieldType. termQuery(Object value, QueryShardContext context)Generates a query that will only match documents that contain the given value.QueryNumberFieldMapper.NumberFieldType. termQuery(Object value, QueryShardContext context)abstract QueryNumberFieldMapper.NumberType. termQuery(String field, Object value)QueryRangeFieldMapper.RangeFieldType. termQuery(Object value, QueryShardContext context)QueryTypeFieldMapper.TypeFieldType. termQuery(Object value, QueryShardContext context)QueryIpFieldMapper.IpFieldType. termsQuery(List<?> values, QueryShardContext context)QueryMappedFieldType. termsQuery(List<?> values, QueryShardContext context)Build a constant-scoring query that matches all values.QueryNumberFieldMapper.NumberFieldType. termsQuery(List values, QueryShardContext context)abstract QueryNumberFieldMapper.NumberType. termsQuery(String field, List<Object> values)QueryStringFieldType. termsQuery(List<?> values, QueryShardContext context)QueryTypeFieldMapper.TypeFieldType. termsQuery(List<?> values, QueryShardContext context)QueryDocumentMapper. typeFilter(QueryShardContext context)QueryMappedFieldType. wildcardQuery(String value, MultiTermQuery.RewriteMethod method, QueryShardContext context)QueryStringFieldType. wildcardQuery(String value, MultiTermQuery.RewriteMethod method, QueryShardContext context)abstract QueryRangeType. withinQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo)Methods in org.elasticsearch.index.mapper with parameters of type Query Modifier and Type Method Description static TermMappedFieldType. extractTerm(Query termQuery)Extract aTermfrom a query created withMappedFieldType.termQuery(java.lang.Object, org.elasticsearch.index.query.QueryShardContext)by recursively removingBoostQuerywrappers. -
Uses of Query in org.elasticsearch.index.query
Methods in org.elasticsearch.index.query that return Query Modifier and Type Method Description protected abstract QueryAbstractGeometryQueryBuilder. buildShapeQuery(QueryShardContext context, MappedFieldType fieldType)builds the appropriate lucene shape queryQueryGeoShapeQueryBuilder. buildShapeQuery(QueryShardContext context, MappedFieldType fieldType)protected QueryAbstractGeometryQueryBuilder. doToQuery(QueryShardContext context)protected abstract QueryAbstractQueryBuilder. doToQuery(QueryShardContext context)protected QueryBoolQueryBuilder. doToQuery(QueryShardContext context)protected QueryBoostingQueryBuilder. doToQuery(QueryShardContext context)protected QueryCommonTermsQueryBuilder. doToQuery(QueryShardContext context)Deprecated.protected QueryConstantScoreQueryBuilder. doToQuery(QueryShardContext context)protected QueryDisMaxQueryBuilder. doToQuery(QueryShardContext context)protected QueryDistanceFeatureQueryBuilder. doToQuery(QueryShardContext context)protected QueryExistsQueryBuilder. doToQuery(QueryShardContext context)protected QueryFuzzyQueryBuilder. doToQuery(QueryShardContext context)QueryGeoBoundingBoxQueryBuilder. doToQuery(QueryShardContext context)protected QueryGeoDistanceQueryBuilder. doToQuery(QueryShardContext shardContext)protected QueryGeoPolygonQueryBuilder. doToQuery(QueryShardContext context)protected QueryIdsQueryBuilder. doToQuery(QueryShardContext context)protected QueryIntervalQueryBuilder. doToQuery(QueryShardContext context)protected QueryMatchAllQueryBuilder. doToQuery(QueryShardContext context)protected QueryMatchBoolPrefixQueryBuilder. doToQuery(QueryShardContext context)protected QueryMatchNoneQueryBuilder. doToQuery(QueryShardContext context)protected QueryMatchPhrasePrefixQueryBuilder. doToQuery(QueryShardContext context)protected QueryMatchPhraseQueryBuilder. doToQuery(QueryShardContext context)protected QueryMatchQueryBuilder. doToQuery(QueryShardContext context)protected QueryMoreLikeThisQueryBuilder. doToQuery(QueryShardContext context)protected QueryMultiMatchQueryBuilder. doToQuery(QueryShardContext context)protected QueryNestedQueryBuilder. doToQuery(QueryShardContext context)protected QueryPrefixQueryBuilder. doToQuery(QueryShardContext context)protected QueryQueryStringQueryBuilder. doToQuery(QueryShardContext context)protected QueryRangeQueryBuilder. doToQuery(QueryShardContext context)protected QueryRegexpQueryBuilder. doToQuery(QueryShardContext context)protected QueryScriptQueryBuilder. doToQuery(QueryShardContext context)protected QuerySimpleQueryStringBuilder. doToQuery(QueryShardContext context)protected QuerySpanContainingQueryBuilder. doToQuery(QueryShardContext context)protected QuerySpanFirstQueryBuilder. doToQuery(QueryShardContext context)protected QuerySpanMultiTermQueryBuilder. doToQuery(QueryShardContext context)protected QuerySpanNearQueryBuilder. doToQuery(QueryShardContext context)protected QuerySpanNotQueryBuilder. doToQuery(QueryShardContext context)protected QuerySpanOrQueryBuilder. doToQuery(QueryShardContext context)protected QuerySpanWithinQueryBuilder. doToQuery(QueryShardContext context)protected QueryTermQueryBuilder. doToQuery(QueryShardContext context)protected QueryTermsQueryBuilder. doToQuery(QueryShardContext context)protected QueryTermsSetQueryBuilder. doToQuery(QueryShardContext context)protected QueryTypeQueryBuilder. doToQuery(QueryShardContext context)protected QueryWildcardQueryBuilder. doToQuery(QueryShardContext context)protected QueryWrapperQueryBuilder. doToQuery(QueryShardContext context)protected QueryVectorGeoShapeQueryProcessor. getVectorQueryFromShape(Geometry queryShape, String fieldName, ShapeRelation relation, QueryShardContext context)static QueryExistsQueryBuilder. newFilter(QueryShardContext context, String fieldPattern)QueryLegacyGeoShapeQueryProcessor. process(Geometry shape, String fieldName, ShapeRelation relation, QueryShardContext context)QueryLegacyGeoShapeQueryProcessor. process(Geometry shape, String fieldName, SpatialStrategy strategy, ShapeRelation relation, QueryShardContext context)QueryVectorGeoShapeQueryProcessor. process(Geometry shape, String fieldName, ShapeRelation relation, QueryShardContext context)QueryParsedQuery. query()The query parsed.QueryAbstractQueryBuilder. toQuery(QueryShardContext context)QueryQueryBuilder. toQuery(QueryShardContext context)Converts this QueryBuilder to a luceneQuery.QuerySpanNearQueryBuilder.SpanGapQueryBuilder. toQuery(QueryShardContext context)Methods in org.elasticsearch.index.query that return types with arguments of type Query Modifier and Type Method Description Map<String,Query>QueryShardContext. copyNamedQueries()Map<String,Query>ParsedQuery. namedFilters()Methods in org.elasticsearch.index.query with parameters of type Query Modifier and Type Method Description voidQueryShardContext. addNamedQuery(String name, Query query)BitSetProducerQueryShardContext. bitsetFilter(Query filter)Constructors in org.elasticsearch.index.query with parameters of type Query Constructor Description ParsedQuery(Query query)ParsedQuery(Query query, Map<String,Query> namedFilters)Store the query and filters.ParsedQuery(Query query, ParsedQuery parsedQuery)Constructor parameters in org.elasticsearch.index.query with type arguments of type Query Constructor Description ParsedQuery(Query query, Map<String,Query> namedFilters)Store the query and filters. -
Uses of Query in org.elasticsearch.index.query.functionscore
Methods in org.elasticsearch.index.query.functionscore that return Query Modifier and Type Method Description protected QueryFunctionScoreQueryBuilder. doToQuery(QueryShardContext context)protected QueryScriptScoreQueryBuilder. doToQuery(QueryShardContext context) -
Uses of Query in org.elasticsearch.index.search
Subclasses of Query in org.elasticsearch.index.search Modifier and Type Class Description classESToParentBlockJoinQueryAToParentBlockJoinQuerythat allows to retrieve its nested path.Methods in org.elasticsearch.index.search that return Query Modifier and Type Method Description protected QueryQueryStringQueryParser. getBooleanQuery(List<BooleanClause> clauses)QueryESToParentBlockJoinQuery. getChildQuery()Return the child query.QueryQueryStringQueryParser. getFieldQuery(String field, String queryText, boolean quoted)protected QueryQueryStringQueryParser. getFieldQuery(String field, String queryText, int slop)protected QueryQueryStringQueryParser. getFuzzyQuery(String field, String termStr, float minSimilarity)protected QueryQueryStringQueryParser. getPrefixQuery(String field, String termStr)protected QueryQueryStringQueryParser. getRangeQuery(String field, String part1, String part2, boolean startInclusive, boolean endInclusive)protected QueryQueryStringQueryParser. getRegexpQuery(String field, String termStr)protected QueryQueryStringQueryParser. getWildcardQuery(String field, String termStr)protected QueryQueryStringQueryParser. handleBareFuzzy(String field, Token fuzzySlop, String termImage)QuerySimpleQueryStringQueryParser. newDefaultQuery(String text)protected QueryQueryStringQueryParser. newFuzzyQuery(Term term, float minimumSimilarity, int prefixLength)QuerySimpleQueryStringQueryParser. newFuzzyQuery(String text, int fuzziness)protected QueryQueryStringQueryParser. newMatchAllDocsQuery()QuerySimpleQueryStringQueryParser. newPhraseQuery(String text, int slop)QuerySimpleQueryStringQueryParser. newPrefixQuery(String text)protected QuerySimpleQueryStringQueryParser. newTermQuery(Term term)QueryMatchQuery. parse(MatchQuery.Type type, String fieldName, Object value)QueryMultiMatchQuery. parse(MultiMatchQueryBuilder.Type type, Map<String,Float> fieldNames, Object value, String minimumShouldMatch)QueryQueryStringQueryParser. parse(String query)protected QueryMatchQuery. parseInternal(MatchQuery.Type type, String fieldName, org.elasticsearch.index.search.MatchQuery.MatchQueryBuilder builder, Object value)QueryESToParentBlockJoinQuery. rewrite(IndexReader reader)protected QueryMatchQuery. zeroTermsQuery()Methods in org.elasticsearch.index.search with parameters of type Query Modifier and Type Method Description booleanNestedHelper. mightMatchNestedDocs(Query query)Returns true if the given query might match nested documents.booleanNestedHelper. mightMatchNonNestedDocs(Query query, String nestedPath)Returns true if the given query might match parent documents or documents that are nested under a different path.Constructors in org.elasticsearch.index.search with parameters of type Query Constructor Description ESToParentBlockJoinQuery(Query childQuery, BitSetProducer parentsFilter, ScoreMode scoreMode, String path) -
Uses of Query in org.elasticsearch.search.fetch.subphase.highlight
Fields in org.elasticsearch.search.fetch.subphase.highlight declared as Query Modifier and Type Field Description QueryHighlighterContext. queryMethods in org.elasticsearch.search.fetch.subphase.highlight that return Query Modifier and Type Method Description QuerySearchContextHighlight.FieldOptions. highlightQuery()Methods in org.elasticsearch.search.fetch.subphase.highlight with parameters of type Query Modifier and Type Method Description voidHighlightPhase. hitExecute(SearchShardTarget shardTarget, QueryShardContext context, Query query, SearchContextHighlight highlight, FetchSubPhase.HitContext hitContext)Constructors in org.elasticsearch.search.fetch.subphase.highlight with parameters of type Query Constructor Description CustomQueryScorer(Query query)CustomQueryScorer(Query query, String field)CustomQueryScorer(Query query, String field, String defaultField)CustomQueryScorer(Query query, IndexReader reader, String field)CustomQueryScorer(Query query, IndexReader reader, String field, String defaultField)HighlighterContext(String fieldName, SearchContextHighlight.Field field, MappedFieldType fieldType, SearchShardTarget shardTarget, QueryShardContext context, SearchContextHighlight highlight, FetchSubPhase.HitContext hitContext, Query query) -
Uses of Query in org.elasticsearch.search.internal
Methods in org.elasticsearch.search.internal that return Query Modifier and Type Method Description QueryFilteredSearchContext. aliasFilter()abstract QuerySearchContext. aliasFilter()QueryFilteredSearchContext. buildFilteredQuery(Query query)abstract QuerySearchContext. buildFilteredQuery(Query query)Automatically apply all required filters to the given query such as alias filters, types filters, etc.QuerySubSearchContext. buildFilteredQuery(Query query)QueryFilteredSearchContext. query()abstract QuerySearchContext. query()The query to execute, might be rewritten.QuerySubSearchContext. query()QueryContextIndexSearcher. rewrite(Query original)Methods in org.elasticsearch.search.internal with parameters of type Query Modifier and Type Method Description QueryFilteredSearchContext. buildFilteredQuery(Query query)abstract QuerySearchContext. buildFilteredQuery(Query query)Automatically apply all required filters to the given query such as alias filters, types filters, etc.QuerySubSearchContext. buildFilteredQuery(Query query)WeightContextIndexSearcher. createWeight(Query query, ScoreMode scoreMode, float boost)QueryContextIndexSearcher. rewrite(Query original) -
Uses of Query in org.elasticsearch.search.profile.query
Constructors in org.elasticsearch.search.profile.query with parameters of type Query Constructor Description ProfileWeight(Query query, Weight subQueryWeight, QueryProfileBreakdown profile) -
Uses of Query in org.elasticsearch.search.rescore
Methods in org.elasticsearch.search.rescore that return Query Modifier and Type Method Description QueryQueryRescorer.QueryRescoreContext. query()Methods in org.elasticsearch.search.rescore that return types with arguments of type Query Modifier and Type Method Description List<Query>QueryRescorer.QueryRescoreContext. getQueries()List<Query>RescoreContext. getQueries()Returns queries associated with the rescorerMethods in org.elasticsearch.search.rescore with parameters of type Query Modifier and Type Method Description voidQueryRescorer.QueryRescoreContext. setQuery(Query query) -
Uses of Query in org.elasticsearch.search.slice
Subclasses of Query in org.elasticsearch.search.slice Modifier and Type Class Description classDocValuesSliceQueryASliceQuerythat uses the numeric doc values of a field to do the slicing.classSliceQueryAn abstractQuerythat defines an hash function to partition the documents in multiple slices.classTermsSliceQueryASliceQuerythat uses the terms dictionary of a field to do the slicing.Methods in org.elasticsearch.search.slice that return Query Modifier and Type Method Description QuerySliceBuilder. toFilter(ClusterService clusterService, ShardSearchRequest request, QueryShardContext context, Version minNodeVersion)Converts this QueryBuilder to a luceneQuery.
-