Package io.constructor.client
Class SearchRequest
java.lang.Object
io.constructor.client.SearchRequest
Constructor.io Search Request
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetNow()
int
int
getPage()
getQuery()
int
boolean
void
setCollectionId
(String collectionId) void
void
setFilterMatchTypes
(Map<String, String> filterMatchTypes) void
setFormatOptions
(Map<String, String> formatOptions) void
setGroupId
(String groupId) void
setHiddenFacets
(List<String> hiddenFacets) void
setHiddenFields
(List<String> hiddenFields) void
void
setOffset
(int offset) void
setPage
(int page) void
setPreFilterExpression
(String preFilterExpression) void
setQsParam
(String qsParam) void
void
setResultsPerPage
(int resultsPerPage) void
setSection
(String section) void
setSortAscending
(boolean sortAscending) void
void
setVariationsMap
(VariationsMap variationsMap)
-
Constructor Details
-
SearchRequest
Creates a search request- Parameters:
query
- the term to return search results for- Throws:
IllegalArgumentException
-
-
Method Details
-
setQuery
- Parameters:
query
- the query to set
-
getQuery
- Returns:
- the query
-
getSection
- Returns:
- the section
-
setSection
- Parameters:
section
- the section to set
-
getPage
public int getPage()- Returns:
- the page
-
setPage
public void setPage(int page) - Parameters:
page
- the page to set (Can't be used together with the 'offset' parameter)
-
getResultsPerPage
public int getResultsPerPage()- Returns:
- the resultsPerPage
-
setResultsPerPage
public void setResultsPerPage(int resultsPerPage) - Parameters:
resultsPerPage
- the resultsPerPage to set
-
getGroupId
- Returns:
- the groupId
-
setGroupId
- Parameters:
groupId
- the groupId to set
-
setFacets
- Parameters:
facets
- the facets to set
-
getFacets
- Returns:
- the facets
-
setSortBy
- Parameters:
sortBy
- the sortBy to set
-
getSortBy
- Returns:
- the sortBy
-
setSortAscending
public void setSortAscending(boolean sortAscending) - Parameters:
sortAscending
- the sortAscending to set
-
getSortAscending
public boolean getSortAscending()- Returns:
- the sortAscending
-
setCollectionId
- Parameters:
collectionId
- the collectionId to set
-
getCollectionId
- Returns:
- the collectionId
-
setFormatOptions
- Parameters:
formatOptions
- the formatOptions to set. Please refer to https://docs.constructor.com/reference/v1-search-get-search-results for details
-
getFormatOptions
- Returns:
- the format options
-
setHiddenFields
- Parameters:
hiddenFields
- the hiddenFields to set
-
getHiddenFields
- Returns:
- the hidden fields
-
setHiddenFacets
- Parameters:
hiddenFacets
- the hiddenFacets to set
-
getHiddenFacets
- Returns:
- the hidden facets
-
setVariationsMap
- Parameters:
variationsMap
- the variationsMap to set
-
getVariationsMap
- Returns:
- the variations map
-
setPreFilterExpression
- Parameters:
preFilterExpression
- the faceting expression to scope search results (JSON-encoded query string). Please refer to https://docs.constructor.com/reference/configuration-collections
-
getPreFilterExpression
- Returns:
- the prefilter expression
-
setQsParam
- Parameters:
qsParam
- any parameters listed in the API documentation can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.com/reference/v1-search-get-search-results/
-
getQsParam
- Returns:
- the qs parameter
-
setNow
- Parameters:
now
- a unix epoch timestamp used to emulate "past" and "future" requests. Please refer to https://docs.constructor.com/reference/v1-search-get-search-results/
-
getNow
- Returns:
- the now parameter
-
setOffset
public void setOffset(int offset) - Parameters:
offset
- the number of results to skip from the beginning (Can't be used together with the 'page' parameter)
-
getOffset
public int getOffset()- Returns:
- the offset
-
setFilterMatchTypes
- Parameters:
filterMatchTypes
- the filterMatchTypes to set. Please refer to https://docs.constructor.com/reference/v1-search-get-search-results for details Possible values 'all', 'any' or 'none'
-
getFilterMatchTypes
- Returns:
- the filterMatchTypes
-