Package org.gbif.api.model.common.search
Class SearchRequest<P extends SearchParameter>
java.lang.Object
org.gbif.api.model.common.paging.PageableBase
org.gbif.api.model.common.search.SearchRequest<P>
- All Implemented Interfaces:
Pageable
- Direct Known Subclasses:
DatasetSuggestRequest
,FacetedSearchRequest
,NameUsageSuggestRequest
Generic request class for search operations. This class contains a list of parameters,
a list of desired facets and paging options (page size and offset).
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.gbif.api.model.common.paging.Pageable
Pageable.OffsetLimitParameters
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor with default paging offset & limit.SearchRequest
(long offset, int limit) Minimal paging constructor.SearchRequest
(String query) Simple query constructor with default paging offset & limit.SearchRequest
(Pageable page) Minimal paging constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(P parameter, boolean value) Adds the specified boolean parameter.void
addParameter
(P parameter, double value) Adds the specified double parameter.void
addParameter
(P parameter, int value) Adds the specified int parameter.void
addParameter
(P parameter, long value) Adds the specified long parameter.void
addParameter
(P parameter, Enum<?> value) Adds the specified parameter.void
addParameter
(P parameter, Iterable<String> values) Adds the specified parameter.void
addParameter
(P parameter, String value) Adds the specified parameter.void
addParameter
(P parameter, String... values) Adds the specified parameter.void
addParameter
(P parameter, Date value) Adds the specified date parameter as an ISO date.void
addParameter
(P parameter, IsoDateInterval value) Adds the specified date parameter as an ISO date interval.Defines the fields to be highlighted if highlighting is activated.List of input parameters of the search operation.getQ()
Query parameter.Defines whether to match against fields with scientific or vernacular names or both.int
boolean
boolean
void
setHighlight
(boolean highlight) void
setHighlightFields
(Set<SearchRequest.QueryField> highlightFields) void
setParameters
(Map<P, Set<String>> parameters) Sets the list of parameters.void
void
setQFields
(Set<SearchRequest.QueryField> qFields) void
setSpellCheck
(boolean spellCheck) void
setSpellCheckCount
(int spellCheckCount) toString()
Methods inherited from class org.gbif.api.model.common.paging.PageableBase
addOffset, copyPagingValues, equals, getLimit, getOffset, hashCode, setLimit, setOffset
-
Constructor Details
-
SearchRequest
public SearchRequest()Constructor with default paging offset & limit. -
SearchRequest
Simple query constructor with default paging offset & limit.- Parameters:
query
- string for request
-
SearchRequest
Minimal paging constructor. -
SearchRequest
Minimal paging constructor.
-
-
Method Details
-
isHighlight
- Returns:
- true if highlighted search matches are requested
-
setHighlight
- Parameters:
highlight
- the highlight to set
-
isSpellCheck
- Returns:
- true if spellCheck search is requested
-
setSpellCheck
- Parameters:
spellCheck
- the highlight to set
-
getSpellCheckCount
- Returns:
- max number of spell check suggestions requested
-
setSpellCheckCount
- Parameters:
spellCheckCount
- number of spell check suggestions
-
getQFields
Defines whether to match against fields with scientific or vernacular names or both. -
setQFields
-
getHighlightFields
Defines the fields to be highlighted if highlighting is activated. -
setHighlightFields
-
getParameters
List of input parameters of the search operation. The parameters are handled as the parameter name and the string representation of its value.- Returns:
- the list of parameters
-
setParameters
Sets the list of parameters. -
getQ
Query parameter.- Returns:
- the q
-
setQ
- Parameters:
q
- the q to set
-
addParameter
Adds the specified parameter.- Parameters:
parameter
- parameter to add values forvalues
- list of values of the parameter to add
-
addParameter
Adds the specified parameter.- Parameters:
parameter
- parameter to add values forvalues
- list of values of the parameter to add
-
addParameter
Adds the specified parameter.- Parameters:
parameter
- parameter to add values forvalue
- value of the parameter to add
-
addParameter
Adds the specified long parameter.- Parameters:
parameter
- parameter to add values forvalue
- value of the parameter to add
-
addParameter
Adds the specified int parameter.- Parameters:
parameter
- parameter to add values forvalue
- value of the parameter to add
-
addParameter
Adds the specified double parameter.- Parameters:
parameter
- parameter to add values forvalue
- value of the parameter to add
-
addParameter
Adds the specified boolean parameter.- Parameters:
parameter
- parameter to add values forvalue
- value of the parameter to add
-
addParameter
Adds the specified parameter.- Parameters:
parameter
- parameter to add values forvalue
- enum value of the parameter to add
-
addParameter
Adds the specified date parameter as an ISO date.- Parameters:
parameter
- parameter to add date forvalue
- date value of the parameter to add
-
addParameter
Adds the specified date parameter as an ISO date interval.- Parameters:
parameter
- parameter to add date interval forvalue
- date value of the parameter to add
-
toString
- Overrides:
toString
in classPageableBase
-