Class DefaultDocumentStore.DefaultSearch<R>
- All Implemented Interfaces:
Search<R>
- Direct Known Subclasses:
DefaultDocumentStore.DefaultGraphSearch
- Enclosing class:
DefaultDocumentStore
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classNested classes/interfaces inherited from interface Search
Search.NullOrder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected io.fluxzero.common.api.search.ModelGraphCompositionprotected List<io.fluxzero.common.api.modeling.ModelGraphPathOverride> Fields inherited from interface Search
defaultFetchSize -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFilters documents with timestamps before the given time.constraint(io.fluxzero.common.api.search.Constraint... constraints) Adds one or more custom constraints to the search using a logical AND.protected Objectprotected <T> Function<io.fluxzero.common.api.search.SerializedDocument, T> protected Class<?> delete(int batchSize) Deletes all matching documents in the current search, using the requested batch size to control how many documents are removed by each delete statement.Excludes specific fields from the returned documents.List<io.fluxzero.common.api.search.FacetStats> Returns facet statistics for the current search.CompletableFuture<List<io.fluxzero.common.api.search.FacetStats>> Asynchronously returns facet statistics for the current search.fetch(int maxSize) Fetches up to the given number of matching documents and deserializes them to the stored type.<T> List<T> Fetches up to the given number of documents and deserializes them to the specified type.fetchAsync(int maxSize) Asynchronously fetches up to the given number of matching documents and deserializes them to the stored type.<T> CompletableFuture<List<T>> fetchAsync(int maxSize, Class<T> type) Asynchronously fetches up to the given number of documents and deserializes them to the specified type.io.fluxzero.common.api.search.SearchHistogramfetchHistogram(int resolution, int maxSize) Computes a histogram for the timestamp distribution of matching documents.fetchHitStream(Integer maxSize, Class<T> type) fetchHitStream(Integer maxSize, Class<T> type, int fetchSize) Groups search results by field(s) and supports aggregations.protected booleanincludeOnly(String... paths) Includes only the specified fields in the returned documents.Filters documents within a specified time range.Moves all matching documents in the current search to the given collection.relation(io.fluxzero.common.api.search.ModelRelationConstraint... constraints) Adds advanced current-state model relationship constraints using logical AND.Filters documents with timestamps since the given start time.Skips the first N results.Sorts results by a field, with control over the sort direction.Sorts results by full-text relevance score.sortByTimestamp(boolean descending) Sorts results by timestamp.Streams raw search hits (document + metadata).streamHits(int fetchSize) Streams raw search hits (document + metadata).streamHits(Class<T> type) Streams raw search hits (document + metadata).streamHits(Class<T> type, int fetchSize) Streams raw search hits (document + metadata).Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Search
aggregate, aggregateAsync, all, any, anyExist, atLeast, before, before, beforeLast, below, between, count, countAsync, delete, fetchAll, fetchAll, fetchFirst, fetchFirst, fetchFirstOrNull, fetchFirstOrNull, inLast, inPeriod, inPeriod, lookAhead, match, match, matchFacet, matchMetadata, not, query, since, since, sortBy, sortBy, sortBy, sortByTimestamp, sortByTimestamp, stream, stream, stream, stream, toInputStream, toInputStream, toNdjsonInputStream, toUtf8InputStream, toUtf8InputStream, whereAncestor, whereAncestor, whereChild, whereDescendant, whereDescendant, whereParent
-
Field Details
-
graphComposition
protected io.fluxzero.common.api.search.ModelGraphComposition graphComposition -
graphPathOverrides
-
-
Constructor Details
-
DefaultSearch
protected DefaultSearch()
-
-
Method Details
-
since
-
before
-
inPeriod
-
constraint
-
relation
Description copied from interface:SearchAdds advanced current-state model relationship constraints using logical AND.Class-based related queries use the model's actual current-document collection. This includes the private, type-isolated collection of a model that participates in graph composition without maintaining a direct public document. Related documents are selected before relationship traversal and target search, so a selective child constraint does not require live composition of unrelated roots.
Implementations that do not support independent-model graph search fail when this method is called.
-
sortByTimestamp
-
sortByScore
-
sortBy
-
exclude
-
includeOnly
-
skip
-
streamHits
Description copied from interface:SearchStreams raw search hits (document + metadata). Documents will typically be fetched in batches from the backing store. For thedefault implementation, the fetch size is 10,000.- Specified by:
streamHitsin interfaceSearch<R>
-
streamHits
Description copied from interface:SearchStreams raw search hits (document + metadata). Documents will be fetched in batches of sizefetchSizefrom the backing store. For thedefault implementation, the fetch size is 10,000.- Specified by:
streamHitsin interfaceSearch<R>
-
streamHits
Description copied from interface:SearchStreams raw search hits (document + metadata). Documents will be fetched in batches of sizefetchSizefrom the backing store. For thedefault implementation, the fetch size is 10,000.- Specified by:
streamHitsin interfaceSearch<R>
-
streamHits
Description copied from interface:SearchStreams raw search hits (document + metadata). Documents will be fetched in batches of sizefetchSizefrom the backing store. For thedefault implementation, the fetch size is 10,000.- Specified by:
streamHitsin interfaceSearch<R>
-
fetch
-
fetch
-
fetchAsync
Description copied from interface:SearchAsynchronously fetches up to the given number of matching documents and deserializes them to the stored type.This is the asynchronous counterpart of
Search.fetch(int). The returned future completes with a materialized list containing at mostmaxSizeresults.- Specified by:
fetchAsyncin interfaceSearch<R>- Parameters:
maxSize- the maximum number of matching documents to fetch- Returns:
- a future containing the deserialized search results
-
fetchAsync
Description copied from interface:SearchAsynchronously fetches up to the given number of documents and deserializes them to the specified type.This is the asynchronous counterpart of
Search.fetch(int, Class). Use this method when handling requests that can return aCompletableFuture; for very large result sets, prefer the streaming methods.- Specified by:
fetchAsyncin interfaceSearch<R>- Type Parameters:
T- the expected result type- Parameters:
maxSize- the maximum number of matching documents to fetchtype- the type to deserialize each document to- Returns:
- a future containing the deserialized search results
-
fetchHitStream
-
fetchHitStream
-
converter
-
convert
-
defaultResultType
-
hasPathFilters
protected boolean hasPathFilters() -
fetchHistogram
public io.fluxzero.common.api.search.SearchHistogram fetchHistogram(int resolution, int maxSize) Description copied from interface:SearchComputes a histogram for the timestamp distribution of matching documents.- Specified by:
fetchHistogramin interfaceSearch<R>
-
groupBy
-
facetStats
Description copied from interface:SearchReturns facet statistics for the current search.- Specified by:
facetStatsin interfaceSearch<R>
-
facetStatsAsync
Description copied from interface:SearchAsynchronously returns facet statistics for the current search.This is the asynchronous counterpart of
Search.facetStats().- Specified by:
facetStatsAsyncin interfaceSearch<R>- Returns:
- a future containing facet value counts for the matching documents
-
delete
Description copied from interface:SearchDeletes all matching documents in the current search, using the requested batch size to control how many documents are removed by each delete statement.The batch size does not limit the total number of documents that are deleted. For a positive batch size, the runtime repeatedly selects and deletes at most that many matching documents until no matches remain. This keeps individual statements and their locks shorter, at the cost of executing multiple statements.
0lets the runtime choose its default batch size;- a positive value sets the maximum number of documents processed per batch;
- a negative value requests deletion with one unbounded statement.
-
move
-