Class SearchDocumentsResult

java.lang.Object
io.fluxcapacitor.common.api.search.SearchDocumentsResult
All Implemented Interfaces:
JsonType, RequestResult

public class SearchDocumentsResult extends Object implements RequestResult
The result of a SearchDocuments request.

This result contains the list of SerializedDocument matches that satisfied the search query.

See Also:
  • Constructor Details

    • SearchDocumentsResult

      public SearchDocumentsResult()
  • Method Details

    • toMetric

      public SearchDocumentsResult.Metric toMetric()
      Converts this result into a serializable metrics object that logs match count and timing, instead of full search result payloads.
      Specified by:
      toMetric in interface JsonType
      Returns:
      a safe and compact object suitable for serialization to the metrics log
    • size

      public int size()
      Returns the number of matched documents.
    • lastMatch

      public SerializedDocument lastMatch()
      Returns the last document in the result list, or null if no matches were found.

      This is typically used for pagination (e.g. passing as lastHit in a follow-up search).