Class SearchDocuments

java.lang.Object
io.fluxcapacitor.common.api.Request
io.fluxcapacitor.common.api.search.SearchDocuments
All Implemented Interfaces:
JsonType

public class SearchDocuments extends Request
Request used to perform a search over documents indexed in the Flux search store.

This class is sent to the Flux platform and supports a rich query mechanism, pagination, sorting, and selective field filtering.

Query: The query field specifies the main search criteria (document type, text query, constraints, etc.).

Sorting: Use sorting to specify the fields used for ordering results. Each entry should refer to a field name, optionally prefixed with - to indicate descending order (e.g., -timestamp).

Pagination: Use skip to offset the result window. The maxSize limits the number of results returned. If lastHit is provided, the search will continue from the given last result (useful for deep pagination).

Path filtering: The pathFilters field lets you restrict which fields are included in each search hit, using glob-like syntax (e.g., details/name, -private/** to exclude sensitive paths). Filtering is applied using computePathFilter().

  • Constructor Details

    • SearchDocuments

      public SearchDocuments()
  • Method Details

    • computePathFilter

      public Predicate<Document.Path> computePathFilter()
      Computes a path-level filter based on the pathFilters list.

      Each entry in the list can be a glob pattern for inclusion (e.g., details/name) or exclusion (e.g., -details/private/**).

      Patterns are matched against both the short and long form of a Document.Path, depending on the structure of the pattern.

      Returns:
      a Predicate that returns true for paths that should be included in search hits.