Package io.constructor.client
Class SearchRequest
java.lang.Object
io.constructor.client.SearchRequest
Constructor.io Search Request
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetNow()intintgetPage()getQuery()intbooleanvoidsetCollectionId(String collectionId) voidvoidsetFilterMatchTypes(Map<String, String> filterMatchTypes) voidsetFormatOptions(Map<String, String> formatOptions) voidsetGroupId(String groupId) voidsetHiddenFacets(List<String> hiddenFacets) voidsetHiddenFields(List<String> hiddenFields) voidvoidsetOffset(int offset) voidsetPage(int page) voidsetPreFilterExpression(String preFilterExpression) voidsetQsParam(String qsParam) voidvoidsetResultsPerPage(int resultsPerPage) voidsetSection(String section) voidsetSortAscending(boolean sortAscending) voidvoidsetVariationsMap(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/shared-filter-expressions
-
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
-