Class SearchRequest

java.lang.Object
io.constructor.client.SearchRequest

public class SearchRequest extends Object
Constructor.io Search Request
  • Constructor Details

  • Method Details

    • setQuery

      public void setQuery(String query)
      Parameters:
      query - the query to set
    • getQuery

      public String getQuery()
      Returns:
      the query
    • getSection

      public String getSection()
      Returns:
      the section
    • setSection

      public void setSection(String section)
      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

      public String getGroupId()
      Returns:
      the groupId
    • setGroupId

      public void setGroupId(String groupId)
      Parameters:
      groupId - the groupId to set
    • setFacets

      public void setFacets(Map<String,List<String>> facets)
      Parameters:
      facets - the facets to set
    • getFacets

      public Map<String,List<String>> getFacets()
      Returns:
      the facets
    • setSortBy

      public void setSortBy(String sortBy)
      Parameters:
      sortBy - the sortBy to set
    • getSortBy

      public String getSortBy()
      Returns:
      the sortBy
    • setSortAscending

      public void setSortAscending(boolean sortAscending)
      Parameters:
      sortAscending - the sortAscending to set
    • getSortAscending

      public boolean getSortAscending()
      Returns:
      the sortAscending
    • setCollectionId

      public void setCollectionId(String collectionId)
      Parameters:
      collectionId - the collectionId to set
    • getCollectionId

      public String getCollectionId()
      Returns:
      the collectionId
    • setFormatOptions

      public void setFormatOptions(Map<String,String> formatOptions)
      Parameters:
      formatOptions - the formatOptions to set. Please refer to https://docs.constructor.io/rest_api/search/queries for details
    • getFormatOptions

      public Map<String,String> getFormatOptions()
      Returns:
      the format options
    • setHiddenFields

      public void setHiddenFields(List<String> hiddenFields)
      Parameters:
      hiddenFields - the hiddenFields to set
    • getHiddenFields

      public List<String> getHiddenFields()
      Returns:
      the hidden fields
    • setHiddenFacets

      public void setHiddenFacets(List<String> hiddenFacets)
      Parameters:
      hiddenFacets - the hiddenFacets to set
    • getHiddenFacets

      public List<String> getHiddenFacets()
      Returns:
      the hidden facets
    • setVariationsMap

      public void setVariationsMap(VariationsMap variationsMap)
      Parameters:
      variationsMap - the variationsMap to set
    • getVariationsMap

      public VariationsMap getVariationsMap()
      Returns:
      the variations map
    • setPreFilterExpression

      public void setPreFilterExpression(String preFilterExpression)
      Parameters:
      preFilterExpression - the faceting expression to scope search results (JSON-encoded query string). Please refer to https://docs.constructor.io/rest_api/collections#add-items-dynamically
    • getPreFilterExpression

      public String getPreFilterExpression()
      Returns:
      the prefilter expression
    • setQsParam

      public void setQsParam(String qsParam)
      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.io/rest_api/search/queries/
    • getQsParam

      public String getQsParam()
      Returns:
      the qs parameter
    • setNow

      public void setNow(String now)
      Parameters:
      now - a unix epoch timestamp used to emulate "past" and "future" requests. Please refer to https://docs.constructor.io/rest_api/search/queries/
    • getNow

      public String 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