Uses of Class
org.apache.lucene.search.Query
Packages that use Query
Package
Description
The logical representation of a
Document for indexing and
searching.Code to maintain and access indices.
Code to search indices.
Some utility classes.
Finite-state automaton for regular expressions.
-
Uses of Query in org.apache.lucene.document
Subclasses of Query in org.apache.lucene.documentModifier and TypeClassDescriptionclassQuery class for searchingRangeFieldtypes by a definedPointValues.Relation.classXYGeometry query forXYDocValuesField.Methods in org.apache.lucene.document that return QueryModifier and TypeMethodDescriptionstatic 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 box *static QueryXYPointField.newBoxQuery(String field, float minX, float maxX, float minY, float maxY) Create a query for matching a bounding box.static QueryXYShape.newBoxQuery(String field, ShapeField.QueryRelation queryRelation, float minX, float maxX, float minY, float maxY) create a query to find all cartesian shapes that intersect a defined bounding box *static 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 QueryLongField.newDistanceFeatureQuery(String field, float weight, long origin, long pivotDistance) 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 QueryLatLonShape.newDistanceQuery(String field, ShapeField.QueryRelation queryRelation, Circle... circle) create a query to find all polygons that intersect a provided circle.static QueryXYPointField.newDistanceQuery(String field, float x, float y, float radius) Create a query for matching points within the specified distance of the supplied location.static QueryXYShape.newDistanceQuery(String field, ShapeField.QueryRelation queryRelation, XYCircle... circle) create a query to find all cartesian shapes that intersect a provided circle (or arrays of circles) *static QueryBinaryPoint.newExactQuery(String field, byte[] value) Create a query for matching an exact binary value.static QueryDoubleField.newExactQuery(String field, double value) Create a query for matching an exact double value.static QueryDoublePoint.newExactQuery(String field, double value) Create a query for matching an exact double value.static QueryFloatField.newExactQuery(String field, float value) Create a query for matching an exact float value.static QueryFloatPoint.newExactQuery(String field, float value) Create a query for matching an exact float value.static QueryInetAddressPoint.newExactQuery(String field, InetAddress value) Create a query for matching a network address.static QueryIntField.newExactQuery(String field, int value) Create a query for matching an exact integer value.static QueryIntPoint.newExactQuery(String field, int value) Create a query for matching an exact integer value.static QueryKeywordField.newExactQuery(String field, String value) Create a query for matching an exactStringvalue.static QueryKeywordField.newExactQuery(String field, BytesRef value) Create a query for matching an exactBytesRefvalue.static QueryLongField.newExactQuery(String field, long value) Create a query for matching an exact long value.static QueryLongPoint.newExactQuery(String field, long value) Create a query for matching an exact long value.static QueryLatLonPoint.newGeometryQuery(String field, ShapeField.QueryRelation queryRelation, LatLonGeometry... latLonGeometries) Create a query for matching one or more geometries against the providedShapeField.QueryRelation.static QueryLatLonShape.newGeometryQuery(String field, ShapeField.QueryRelation queryRelation, LatLonGeometry... latLonGeometries) create a query to find all indexed geo shapes that intersect a provided geometry (or array of geometries).static QueryShapeDocValuesField.newGeometryQuery(String field, ShapeField.QueryRelation relation, Object... geometries) Creates a geometry query for shape docvaluesstatic QueryXYPointField.newGeometryQuery(String field, XYGeometry... xyGeometries) create a query to find all indexed shapes that intersect a provided geometry collection.static QueryXYShape.newGeometryQuery(String field, ShapeField.QueryRelation queryRelation, XYGeometry... xyGeometries) create a query to find all indexed geo shapes that intersect a provided geometry collection note: Components do not support dateline crossingstatic 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 QueryFeatureField.newLinearQuery(String fieldName, String featureName, float weight) Return a newQuerythat will score documents asweight * Swhere S is the value of the static feature.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 QueryXYShape.newLineQuery(String field, ShapeField.QueryRelation queryRelation, XYLine... lines) create a query to find all cartesian shapes that intersect a provided linestring (or array of linestrings) *static QueryFeatureField.newLogQuery(String fieldName, String featureName, float weight, float scalingFactor) Return a newQuerythat will score documents asweight * Math.log(scalingFactor + S)where S is the value of the static feature.static QueryLatLonShape.newPointQuery(String field, ShapeField.QueryRelation queryRelation, double[]... points) create a query to find all indexed shapes that comply theShapeField.QueryRelationwith the provided pointsstatic QueryXYShape.newPointQuery(String field, ShapeField.QueryRelation queryRelation, float[]... points) create a query to find all indexed shapes that comply theShapeField.QueryRelationwith the provided pointstatic 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 QueryXYPointField.newPolygonQuery(String field, XYPolygon... polygons) Create a query for matching one or more polygons.static QueryXYShape.newPolygonQuery(String field, ShapeField.QueryRelation queryRelation, XYPolygon... polygons) create a query to find all cartesian shapes that intersect a provided polygon (or array of polygons) *static QueryInetAddressPoint.newPrefixQuery(String field, InetAddress value, int prefixLength) Create a prefix query for matching a CIDR network range.static QueryBinaryPoint.newRangeQuery(String field, byte[][] lowerValue, byte[][] upperValue) Create a range query for n-dimensional binary values.static QueryBinaryPoint.newRangeQuery(String field, byte[] lowerValue, byte[] upperValue) Create a range query for binary values.static QueryDoubleField.newRangeQuery(String field, double lowerValue, double upperValue) Create a range query for double values.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 QueryFloatField.newRangeQuery(String field, float lowerValue, float upperValue) Create a range query for float 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 QueryInetAddressPoint.newRangeQuery(String field, InetAddress lowerValue, InetAddress upperValue) Create a range query for network addresses.static QueryIntField.newRangeQuery(String field, int lowerValue, int upperValue) Create a range query for integer values.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 QueryLongField.newRangeQuery(String field, long lowerValue, long upperValue) Create a range query for long 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 QueryFeatureField.newSaturationQuery(String fieldName, String featureName) Same asFeatureField.newSaturationQuery(String, String, float, float)but1fis used as a weight and a reasonably good default pivot value is computed based on index statistics and is approximately equal to the geometric mean of all values that exist in the index.static QueryFeatureField.newSaturationQuery(String fieldName, String featureName, float weight, float pivot) Return a newQuerythat will score documents asweight * S / (S + pivot)where S is the value of the static feature.static QueryBinaryPoint.newSetQuery(String field, byte[]... values) Create a query matching any of the specified 1D values.static QueryDoubleField.newSetQuery(String field, double... values) Create a query matching values in a supplied setstatic 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 QueryFloatField.newSetQuery(String field, float... values) Create a query matching values in a supplied setstatic 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 QueryInetAddressPoint.newSetQuery(String field, InetAddress... values) Create a query matching any of the specified 1D values.static QueryIntField.newSetQuery(String field, int... values) Create a query matching values in a supplied setstatic 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 QueryKeywordField.newSetQuery(String field, Collection<BytesRef> values) Create a query for matching any of a set of providedBytesRefvalues.static QueryLongField.newSetQuery(String field, long... values) Create a query matching values in a supplied setstatic 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 QueryFeatureField.newSigmoidQuery(String fieldName, String featureName, float weight, float pivot, float exp) Return a newQuerythat will score documents asweight * S^a / (S^a + pivot^a)where S is the value of the static feature.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 QueryXYDocValuesField.newSlowBoxQuery(String field, float minX, float maxX, float minY, float maxY) 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 QueryXYDocValuesField.newSlowDistanceQuery(String field, float x, float y, float radius) Create a query for matching points within the specified distance of the supplied location.static QueryLatLonShape.newSlowDocValuesBoxQuery(String field, ShapeField.QueryRelation queryRelation, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude) create a docvalue query to find all geo shapes that intersect a defined bounding box *static QueryXYShape.newSlowDocValuesBoxQuery(String field, ShapeField.QueryRelation queryRelation, float minX, float maxX, float minY, float maxY) create a docvalue query to find all cartesian shapes that intersect a defined bounding box *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.newSlowGeometryQuery(String field, ShapeField.QueryRelation queryRelation, LatLonGeometry... latLonGeometries) Create a query for matching one or more geometries against the providedShapeField.QueryRelation.static QueryXYDocValuesField.newSlowGeometryQuery(String field, XYGeometry... geometries) Create a query for matching points within the supplied geometries.static QueryDoubleRangeDocValuesField.newSlowIntersectsQuery(String field, double[] min, double[] max) Create a new range query that finds all ranges that intersect using doc values.static QueryFloatRangeDocValuesField.newSlowIntersectsQuery(String field, float[] min, float[] max) Create a new range query that finds all ranges that intersect using doc values.static QueryIntRangeDocValuesField.newSlowIntersectsQuery(String field, int[] min, int[] max) Create a new range query that finds all ranges that intersect using doc values.static QueryLongRangeDocValuesField.newSlowIntersectsQuery(String field, long[] min, long[] max) Create a new range query that finds all ranges that intersect using doc values.static QueryLatLonDocValuesField.newSlowPolygonQuery(String field, Polygon... polygons) Create a query for matching points within the supplied polygons.static QueryXYDocValuesField.newSlowPolygonQuery(String field, XYPolygon... 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 QueryNumericDocValuesField.newSlowSetQuery(String field, long... values) Create a query matching any of the specified values.static QuerySortedDocValuesField.newSlowSetQuery(String field, Collection<BytesRef> values) Create a query matching any of the specified values.static QuerySortedNumericDocValuesField.newSlowSetQuery(String field, long... values) Create a query matching any of the specified values.static QuerySortedSetDocValuesField.newSlowSetQuery(String field, Collection<BytesRef> values) Create a query matching any of the specified values.static QueryKnnByteVectorField.newVectorQuery(String field, byte[] queryVector, int k) Create a new vector query for the provided field targeting the byte vectorstatic QueryKnnFloatVectorField.newVectorQuery(String field, float[] queryVector, int k) Create a new vector query for the provided field targeting the float vectorstatic 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 QueryModifier and TypeMethodDescriptionlongIndexWriter.deleteDocuments(Query... queries) Deletes the document(s) matching any of the provided queries.longIndexWriter.updateDocuments(Query delQuery, Iterable<? extends Iterable<? extends IndexableField>> docs) Similar toIndexWriter.updateDocuments(Term, Iterable), but take a query instead of a term to identify the documents to be updatedConstructor parameters in org.apache.lucene.index with type arguments of type QueryModifierConstructorDescriptionSoftDeletesRetentionMergePolicy(String field, Supplier<Query> retentionQuerySupplier, MergePolicy in) Creates a newSoftDeletesRetentionMergePolicy -
Uses of Query in org.apache.lucene.search
Subclasses of Query in org.apache.lucene.searchModifier and TypeClassDescriptionclassAQuerythat will match terms against a finite-state machine.final classAQuerythat blends index statistics across multiple terms.classA Query that matches documents matching boolean combinations of other queries, e.g.final classAQuerywrapper that allows to give a boost to the wrapped query.classSearch for all (approximate) byte vectors above a similarity threshold.final classAQuerythat treats multiple fields as a single stream and scores terms as if they had been indexed in a single field whose values would be the union of the values of the provided fields.final classA query that wraps another query and simply returns a constant score equal to 1 for every document that matches the query.final classA 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.classAQuerythat matches documents that contain either aKnnFloatVectorField,KnnByteVectorFieldor a field that indexes norms or doc values.classSearch for all (approximate) float vectors above a similarity threshold.classImplements the fuzzy search query.final classA 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.classA range query that can take advantage of the fact that the index is sorted to speed up execution.classA Query that matches documents matching combinations of subqueries.classA Basic abstract query that all IndriQueries can extend to implement toString, equals, getClauses, and iterator.classUsesKnnVectorsReader.search(String, byte[], KnnCollector, Bits)to perform nearest neighbour search.classUsesKnnVectorsReader.search(String, float[], KnnCollector, Bits)to perform nearest neighbour search.final classA query that matches all documents.classA query that matches no documents.classA generalized version ofPhraseQuery, with the possibility of adding more than one term at the same position that are treated as a disjunction (OR).classAn abstractQuerythat matches documents containing a subset of terms provided by aFilteredTermsEnumenumeration.classThis is aPhraseQuerywhich is optimized for n-gram phrase query.classThis is a version of knn vector query that exits early when HNSW queue saturates over a#saturationThresholdfor more than#patiencetimes.classA Query that matches documents containing a particular sequence of terms.classAbstract query class to find all documents whose single or multi-dimensional point values, previously indexed with e.g.classAbstract class for range queries against single or multidimensional points such asIntPoint.classA Query that matches documents containing terms with a specified prefix.classA fast regular expression query based on theorg.apache.lucene.util.automatonpackage.classThis is a version of knn vector query that provides a query seed to initiate the vector search.final classA query that treats multiple terms as synonyms.classSpecialization for a disjunction over many terms that, by default, behaves like aConstantScoreQueryover aBooleanQuerycontaining onlyBooleanClause.Occur.SHOULDclauses.classA Query that matches documents containing a term.classA Query that matches documents within an range of terms.classImplements the wildcard search query.Fields in org.apache.lucene.search declared as QueryModifier and TypeFieldDescriptionprotected final QueryAbstractKnnVectorQuery.filterprotected final QueryAbstractKnnVectorQuery.filterprotected final QueryAbstractKnnVectorQuery.filterprotected final QueryAbstractKnnVectorQuery.filterprotected final QueryAbstractVectorSimilarityQuery.filterprotected final QueryAbstractVectorSimilarityQuery.filterprotected final QueryWeight.parentQueryMethods in org.apache.lucene.search that return QueryModifier and TypeMethodDescriptionprotected QueryMultiTermQuery.TopTermsBlendedFreqScoringRewrite.build(BlendedTermQuery.Builder builder) protected QueryMultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite.build(BooleanQuery.Builder builder) protected QueryMultiTermQuery.TopTermsScoringBooleanQueryRewrite.build(BooleanQuery.Builder builder) IndexSortSortedNumericDocValuesRangeQuery.getFallbackQuery()PatienceKnnVectorQuery.getFilter()SeededKnnVectorQuery.getFilter()IndexOrDocValuesQuery.getIndexQuery()Return the wrapped query that may be costly to initialize but has a good iterator.BoostQuery.getQuery()Return the wrappedQuery.ConstantScoreQuery.getQuery()Returns the encapsulated query.FilterMatchesIterator.getQuery()MatchesIterator.getQuery()Returns the Query causing the current matchfinal QueryWeight.getQuery()The query that this concerns.IndexOrDocValuesQuery.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.BooleanClause.query()Returns the value of thequeryrecord component.final QueryBlendedTermQuery.rewrite(IndexSearcher indexSearcher) abstract QueryMerge the provided sub queries into a singleQueryobject.BooleanQuery.rewrite(IndexSearcher indexSearcher) BoostQuery.rewrite(IndexSearcher indexSearcher) CombinedFieldQuery.rewrite(IndexSearcher indexSearcher) ConstantScoreQuery.rewrite(IndexSearcher indexSearcher) DisjunctionMaxQuery.rewrite(IndexSearcher indexSearcher) Optimize our representation and our subqueries representationsDocValuesRewriteMethod.rewrite(IndexSearcher indexSearcher, MultiTermQuery query) FieldExistsQuery.rewrite(IndexSearcher indexSearcher) IndexOrDocValuesQuery.rewrite(IndexSearcher indexSearcher) Expert: called to re-write queries into primitive queries.IndexSortSortedNumericDocValuesRangeQuery.rewrite(IndexSearcher indexSearcher) MultiPhraseQuery.rewrite(IndexSearcher indexSearcher) final QueryMultiTermQuery.rewrite(IndexSearcher indexSearcher) To rewrite to a simpler form, instead return a simpler enum fromMultiTermQuery.getTermsEnum(Terms, AttributeSource).abstract QueryMultiTermQuery.RewriteMethod.rewrite(IndexSearcher indexSearcher, MultiTermQuery query) NGramPhraseQuery.rewrite(IndexSearcher indexSearcher) PhraseQuery.rewrite(IndexSearcher indexSearcher) Query.rewrite(IndexSearcher indexSearcher) Expert: called to re-write queries into primitive queries.final QueryScoringRewrite.rewrite(IndexSearcher indexSearcher, MultiTermQuery query) SeededKnnVectorQuery.rewrite(IndexSearcher indexSearcher) SynonymQuery.rewrite(IndexSearcher indexSearcher) final QueryTopTermsRewrite.rewrite(IndexSearcher indexSearcher, MultiTermQuery query) static QueryWrap a Query so that it associates a name with itsMatchesMethods in org.apache.lucene.search that return types with arguments of type QueryModifier and TypeMethodDescriptionBooleanQuery.getClauses(BooleanClause.Occur occur) Return the collection of queries for the givenBooleanClause.Occur.DisjunctionMaxQuery.getDisjuncts()DisjunctionMaxQuery.iterator()Methods in org.apache.lucene.search with parameters of type QueryModifier and TypeMethodDescriptionBooleanQuery.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, Supplier<ByteRunAutomaton> automaton) Called by leaf queries that match on a class of termsintCount how many documents match the given query.IndexSearcher.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.Returns an Explanation that describes howdocscored againstquery.static SeededKnnVectorQuerySeededKnnVectorQuery.fromByteQuery(KnnByteVectorQuery knnQuery, Query seed) Construct a new SeededKnnVectorQuery instance for a byte vector fieldstatic SeededKnnVectorQuerySeededKnnVectorQuery.fromFloatQuery(KnnFloatVectorQuery knnQuery, Query seed) Construct a new SeededKnnVectorQuery instance for a float vector fieldstatic DoubleValuesSourceCreate a DoubleValuesSource that returns the score of a particular queryQueryVisitor.getSubVisitor(BooleanClause.Occur occur, Query parent) Pulls a visitor instance for visiting child clauses of a queryprotected intUsageTrackingQueryCachingPolicy.minFrequencyToCache(Query query) For a given filter, return how many times it should appear in the history before being cached.protected voidExpert: callback when there is a cache hit on a given query.protected voidExpert: 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.voidCallback that is called every time that a cached filter is used.voidstatic 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 * secondPassScoreabstract QueryMerge the provided sub queries into a singleQueryobject.Expert: called to re-write queries into primitive queries.Finds the topnhits forquery.Search implementation with arbitrary sorting.Search implementation with arbitrary sorting, plus control over whether hit scores and max score should be computed.voidDeprecated.<C extends Collector,T>
TIndexSearcher.search(Query query, CollectorManager<C, T> collectorManager) Lower-level search API.IndexSearcher.searchAfter(ScoreDoc after, Query query, int numHits) Finds the topnhits forquerywhere all results are after a previous result (after).IndexSearcher.searchAfter(ScoreDoc after, Query query, int n, Sort sort) Finds the topnhits forquerywhere all results are after a previous result (after).IndexSearcher.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) voidCalled by leaf queries that do not match on termsstatic QueryWrap a Query so that it associates a name with itsMatchesConstructors in org.apache.lucene.search with parameters of type QueryModifierConstructorDescriptionBooleanClause(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.ByteVectorSimilarityQuery(String field, byte[] target, float traversalSimilarity, float resultSimilarity, Query filter) Search for all (approximate) byte vectors above a similarity threshold usingVectorSimilarityCollector.ByteVectorSimilarityQuery(String field, byte[] target, float resultSimilarity, Query filter) Search for all (approximate) byte vectors above a similarity threshold usingVectorSimilarityCollector.ConstantScoreQuery(Query query) Strips off scores from the passed in Query.protectedConstantScoreWeight(Query query, float score) protectedFilterWeight(Query query, Weight weight) Alternative constructor.FloatVectorSimilarityQuery(String field, float[] target, float traversalSimilarity, float resultSimilarity, Query filter) Search for all (approximate) float vectors above a similarity threshold usingVectorSimilarityCollector.FloatVectorSimilarityQuery(String field, float[] target, float resultSimilarity, Query filter) Search for all (approximate) float vectors above a similarity threshold usingVectorSimilarityCollector.IndexOrDocValuesQuery(Query indexQuery, Query dvQuery) Create anIndexOrDocValuesQuery.IndexSortSortedNumericDocValuesRangeQuery(String field, long lowerValue, long upperValue, Query fallbackQuery) Creates a newIndexSortSortedNumericDocValuesRangeQuery.KnnByteVectorQuery(String field, byte[] target, int k, Query filter) Find theknearest documents to the target vector according to the vectors in the given field.KnnByteVectorQuery(String field, byte[] target, int k, Query filter, KnnSearchStrategy searchStrategy) Find theknearest documents to the target vector according to the vectors in the given field.KnnFloatVectorQuery(String field, float[] target, int k, Query filter) Find theknearest documents to the target vector according to the vectors in the given field.KnnFloatVectorQuery(String field, float[] target, int k, Query filter, KnnSearchStrategy searchStrategy) Find theknearest documents to the target vector according to the vectors in the given field.protectedPhraseWeight(Query query, String field, IndexSearcher searcher, ScoreMode scoreMode) Expert: Creates PhraseWeight instanceQueryRescorer(Query query) Sole constructor, passing the 2nd pass query to assign scores to the 1st pass hits.protectedSole constructor, typically invoked by sub-classes.Constructor parameters in org.apache.lucene.search with type arguments of type QueryModifierConstructorDescriptionDisjunctionMaxQuery(Collection<? extends Query> disjuncts, float tieBreakerMultiplier) Creates a new DisjunctionMaxQuery -
Uses of Query in org.apache.lucene.util
Methods in org.apache.lucene.util that return QueryModifier and TypeMethodDescriptionprotected 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 contentsQueryBuilder.createBooleanQuery(String field, String queryText) Creates a boolean query from the query text.QueryBuilder.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.QueryBuilder.createMinShouldMatchQuery(String field, String queryText, float fraction) Creates a minimum-should-match query from the query text.QueryBuilder.createPhraseQuery(String field, String queryText) Creates a phrase query from the query text.QueryBuilder.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(String field, QueryBuilder.TermAndBoost[] terms) Builds a new SynonymQuery instance.protected QueryQueryBuilder.newTermQuery(Term term, float boost) Builds a new TermQuery instance.Methods in org.apache.lucene.util with parameters of type QueryModifier and TypeMethodDescriptionstatic longReturns the size in bytes of a Query object.static longReturns the size in bytes of a Query object.Method parameters in org.apache.lucene.util with type arguments of type QueryModifier and TypeMethodDescriptionprotected 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 QueryModifier and TypeMethodDescriptionvoidCompiledAutomaton.visit(QueryVisitor visitor, Query parent, String field) Report back to a QueryVisitor how this automaton matches terms
IndexSearcher.search(Query, CollectorManager)due to its support for concurrency in IndexSearcher