Class SearchResponse

java.lang.Object
ai.vectros.types.SearchResponse

public final class SearchResponse extends Object
  • Method Details

    • getResults

      public Optional<List<SearchResult>> getResults()
      Returns:
      The matched content chunks, ordered from most to least relevant.
    • getTotalResults

      public Optional<Integer> getTotalResults()
      Returns:
      The total number of items that matched the query (the size of the matching pool). This may be larger than the number of results returned in this response, which is capped by limit.
    • getSearchTimeMs

      public Optional<Long> getSearchTimeMs()
      Returns:
      How long the search took to run, in milliseconds.
    • getDegraded

      public Optional<Boolean> getDegraded()
      Returns:
      True when one of the two search engines was unavailable and these results came from the surviving engine only (for example, keyword search fell back to semantic-only during an outage). When true, the results may be less complete than a healthy hybrid search. Set requireComplete to true on your request to receive a 503 instead of partial results.
    • getDegradedLegs

      public Optional<List<String>> getDegradedLegs()
      Returns:
      Which search engines were unavailable for this response: text (keyword) and/or vector (semantic). Empty when the search was not degraded.
    • getHasMore

      public Optional<Boolean> getHasMore()
      Returns:
      True when more matching results are available past this page. Raise limit or advance offset (up to its max of 200) to fetch them; false also once offset is at its max, since no further page is reachable regardless of how many results exist.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static SearchResponse.Builder builder()