Class DefaultHitLocations
- java.lang.Object
-
- com.couchbase.client.java.search.result.hits.DefaultHitLocations
-
- All Implemented Interfaces:
HitLocations
@Uncommitted @Public public class DefaultHitLocations extends Object implements HitLocations
A default implementation of aHitLocations.- Since:
- 2.3.0
- Author:
- Simon Baslé, Michael Nitschinger
-
-
Constructor Summary
Constructors Constructor Description DefaultHitLocations()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HitLocationsadd(HitLocation l)add a location and allow method chaininglongcount()size of all()List<String>fields()list the fields in this locationstatic HitLocationsfrom(JsonObject locationsJson)Parses a FTS JSON representation of aHitLocations.List<HitLocation>get(String field)list all locations for a given field (any term)List<HitLocation>get(String field, String term)list all locations for a given field and termList<HitLocation>getAll()list all locations (any field, any term)Set<String>terms()list all terms in this locations, considering all fields (so a set)List<String>termsFor(String field)list the terms for a given fieldStringtoString()
-
-
-
Method Detail
-
add
public HitLocations add(HitLocation l)
Description copied from interface:HitLocationsadd a location and allow method chaining- Specified by:
addin interfaceHitLocations
-
get
public List<HitLocation> get(String field)
Description copied from interface:HitLocationslist all locations for a given field (any term)- Specified by:
getin interfaceHitLocations
-
get
public List<HitLocation> get(String field, String term)
Description copied from interface:HitLocationslist all locations for a given field and term- Specified by:
getin interfaceHitLocations
-
getAll
public List<HitLocation> getAll()
Description copied from interface:HitLocationslist all locations (any field, any term)- Specified by:
getAllin interfaceHitLocations
-
count
public long count()
Description copied from interface:HitLocationssize of all()- Specified by:
countin interfaceHitLocations
-
fields
public List<String> fields()
Description copied from interface:HitLocationslist the fields in this location- Specified by:
fieldsin interfaceHitLocations
-
termsFor
public List<String> termsFor(String field)
Description copied from interface:HitLocationslist the terms for a given field- Specified by:
termsForin interfaceHitLocations
-
terms
public Set<String> terms()
Description copied from interface:HitLocationslist all terms in this locations, considering all fields (so a set)- Specified by:
termsin interfaceHitLocations
-
from
public static HitLocations from(JsonObject locationsJson)
Parses a FTS JSON representation of aHitLocations.
-
-