Class Document

java.lang.Object
io.fluxzero.common.search.Document

public class Document extends Object
Represents a structured, searchable, and indexable document within a Fluxzero collection.

A Document encapsulates metadata (such as ID, type, revision, timestamps) and document content structured as a map of Document.Entry values associated with one or more Document.Paths.

Documents are typically constructed from user-defined data and then serialized via SerializedDocument for indexing, querying, or audit purposes.

Components

  • entries: the core field/value content of the document, including support for multiple path aliases
  • facets: fast lookup values, commonly used in FacetStats
  • indexes: normalized and sortable values (e.g. timestamps, numbers) used for filtering and sorting
See Also:
  • Field Details

  • Constructor Details

    • Document

      public Document()
  • Method Details

    • isSearchablePath

      public boolean isSearchablePath(Document.Path path)
      Returns whether this concrete property path participates in text matching. Excluded values remain available for deserialization, existence and range constraints, facets, and sorting.
    • getSummary

      public String getSummary()
      Retrieves the summary of the document or null if no summary is available.

      A summary describes the document contents as a single string concatenating all property values.

    • getEntryAtPath

      public Optional<Document.Entry> getEntryAtPath(String queryPath)
      Retrieves the first matching Document.Entry for a given query path.
    • getMatchingEntries

      public Stream<Document.Entry> getMatchingEntries(Predicate<Document.Path> pathPredicate)
      Retrieves a stream of entries that match the provided path predicate.
    • getSortableEntries

      public Stream<SortableEntry> getSortableEntries(Predicate<Document.Path> pathPredicate)
      Retrieves a stream of SortableEntry objects from the document's indexes that match the provided path predicate.
    • filterPaths

      public Document filterPaths(Predicate<Document.Path> pathFilter)
      Filters document entries by a Document.Path predicate, retaining internal search exclusions so that subsequent matching cannot make an excluded property searchable.
    • getEnd

      public Instant getEnd()
    • createComparator

      public static Comparator<Document> createComparator(SearchDocuments searchDocuments)
      Constructs a Comparator to sort documents based on the sorting options in SearchDocuments.