Class SearchRow

java.lang.Object
com.couchbase.client.java.search.result.SearchRow

public class SearchRow extends Object
An FTS result row (or hit).
Since:
2.3.0
  • Constructor Details

  • Method Details

    • index

      public String index()
      The name of the FTS index that gave this result.
    • id

      public String id()
      The id of the matching document.
    • score

      public double score()
      The score of this hit.
    • explanation

      public JsonObject explanation()
      If SearchOptions.explain(boolean) was set to true, returns an explanation of the match. Otherwise, returns an empty object. Intended for diagnostic use only; the structure of the JSON is unspecified, and not part of the public committed API.
    • locations

      public Optional<SearchRowLocations> locations()
      This rows's location, as an SearchRowLocations map-like object.
    • fragments

      public Map<String,List<String>> fragments()
      The fragments for each field that was requested as highlighted (as defined in the SearchParams).

      A fragment is an extract of the field's value where the matching terms occur. Matching terms are surrounded by a <match> tag.

      Returns:
      the fragments as a Map. Keys are the fields.
    • fieldsAs

      public <T> T fieldsAs(Class<T> target)
      The value of each requested field (as defined in the SearchQuery.
      Returns:
      the fields mapped to the given target type
    • fieldsAs

      public <T> T fieldsAs(TypeRef<T> target)
      The value of each requested field (as defined in the SearchQuery.
      Returns:
      the fields mapped to the given target type
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object