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 Summary
Constructors Constructor Description SearchRow(String index, String id, double score, JsonObject explanation, Optional<SearchRowLocations> locations, Map<String,List<String>> fragments, byte[] fields, JsonSerializer serializer) -
Method Summary
Modifier and Type Method Description booleanequals(Object o)JsonObjectexplanation()IfSearchOptions.explain(boolean)() requested in the query}, an explanation of the match, in JSON form.<T> TfieldsAs(TypeRef<T> target)The value of each requested field (as defined in theSearchQuery.<T> TfieldsAs(Class<T> target)The value of each requested field (as defined in theSearchQuery.Map<String,List<String>>fragments()The fragments for each field that was requested as highlighted (as defined in theSearchParams).static SearchRowfromResponse(SearchChunkRow row, JsonSerializer serializer)inthashCode()Stringid()The id of the matching document.Stringindex()The name of the FTS index that gave this result.Optional<SearchRowLocations>locations()This rows's location, as anSearchRowLocationsmap-like object.doublescore()The score of this hit.StringtoString()
-
Constructor Details
-
SearchRow
public SearchRow(String index, String id, double score, JsonObject explanation, Optional<SearchRowLocations> locations, Map<String,List<String>> fragments, byte[] fields, JsonSerializer serializer)
-
-
Method Details
-
index
The name of the FTS index that gave this result. -
id
The id of the matching document. -
score
public double score()The score of this hit. -
explanation
IfSearchOptions.explain(boolean)() requested in the query}, an explanation of the match, in JSON form. -
locations
This rows's location, as anSearchRowLocationsmap-like object. -
fragments
The fragments for each field that was requested as highlighted (as defined in theSearchParams).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
The value of each requested field (as defined in theSearchQuery.- Returns:
- the fields mapped to the given target type
-
fieldsAs
The value of each requested field (as defined in theSearchQuery.- Returns:
- the fields mapped to the given target type
-
equals
-
hashCode
public int hashCode() -
fromResponse
-
toString
-