Interface SearchResult

All Known Implementing Classes:
SolrSearchResult

public interface SearchResult
  • Method Details

    • getOffset

      int getOffset()
      Use for pagination
      Returns:
      the offset of the pages, 0 for the first page, 1 for the second, and so on
    • getPageSize

      int getPageSize()
      Use for pagination
      Returns:
      size of the page
    • hasNext

      boolean hasNext()
      Use for pagination
      Returns:
      true if the next page is available, false otherwise.
    • hasPrevious

      boolean hasPrevious()
      Use for pagination
      Returns:
      true if the previous page is available, false otherwise.
    • getNumberOfPages

      long getNumberOfPages()
      Use for pagination
      Returns:
      number of pages
    • getNumberOfResults

      long getNumberOfResults()
      Returns the number of results. If result grouping is being used, this is the number of groups.
      Returns:
      the number of results
    • getIdentifiers

      List<String> getIdentifiers()
      Searches for the identifiers saved in the index, for example, "sony_online", "ati_staged", or "just_name"
      Returns:
      collection of all identifiers
    • getResultPKs

      List<PK> getResultPKs() throws FacetSearchException
      Searches for all result PKs.
      Returns:
      resulting items PK
      Throws:
      FacetSearchException
    • getResultCodes

      List<String> getResultCodes() throws FacetSearchException
      Searches for item's codes.
      Returns:
      List items codes as Strings
      Throws:
      FacetSearchException
    • getResults

      List<? extends ItemModel> getResults() throws FacetSearchException
      Searches for all result items. Example, [product_01, product_02], or [cms_01, cms_02, cms_03]
      Returns:
      all items
      Throws:
      FacetSearchException
    • getResultData

      <T> List<T> getResultData(ConverterType converterType)
      Returns SOLR results in form of a simple data objects (DTO's)
    • getDocuments

      List<Document> getDocuments()
      Returns the document that represent the main results.
      Returns:
      the documents
    • setGroupCommandResult

      void setGroupCommandResult(SearchResultGroupCommand groupCommandResult)
      Sets the group command result.
      Parameters:
      groupCommandResult - - the group command result
    • getGroupCommandResult

      SearchResultGroupCommand getGroupCommandResult()
      Returns the group command result.
      Returns:
      the group command result
    • getGroupCommands

      @Deprecated(since="2105", forRemoval=true) List<SearchResultGroupCommand> getGroupCommands()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the group results.
      Returns:
      the group results
    • getFacetNames

      Set<String> getFacetNames()
      Searches for all root facet names. Example: [manufacturers, prices, categories]
      Returns:
      all root facet names
    • containsFacet

      boolean containsFacet(String name)
      Checks if the specified name is a facet. For example, manufacturers --> true, admin --> false
      Parameters:
      name - name of the root facet
      Returns:
      true if found, false otherwise
    • getFacet

      Facet getFacet(String name)
      Searches for the root of a facet tree which contains the Facet and all FacetValues, for example, manufacturers(Facet) contains [eizo, ati, ..](FacetValue)
      Parameters:
      name - name of the facet
      Returns:
      found facet or null when facet with given name is not available
    • getFacets

      List<Facet> getFacets()
      Searches for all available facets which contain the whole tree, manufacturers [eizo, ati, ..], prices [100-499,500-999],categories [online, staged]
      Returns:
      all available facets
    • getSpellingSuggestion

      String getSpellingSuggestion()
      Get the best suggestion from the spellchecker. Returns null if spell checker is not enabled, or no better suggestion than the user's query is found. Requires the UserQuery to be set on the SearchQuery.
    • getKeywordRedirects

      List<KeywordRedirectValue> getKeywordRedirects()
    • getAvailableNamedSorts

      List<IndexedTypeSort> getAvailableNamedSorts()
      Return list of available named sorts.
      Returns:
      List of IndexedTypeSort
    • getCurrentNamedSort

      IndexedTypeSort getCurrentNamedSort()
      Return currently selected sort.
      Returns:
      current sort
    • getBreadcrumbs

      List<Breadcrumb> getBreadcrumbs()
      Return bread-crumbs for the current search result state.
      Returns:
      List of Breadcrumb
    • getQueryInfo

      SearchQueryInfo getQueryInfo()
      Statistics Info about the Search Query - usable for logging
    • getSolrObject

      org.apache.solr.client.solrj.response.QueryResponse getSolrObject()
      Searches for the underlying implementation.
      Returns:
      The result object of the underlying implementation.
    • getAttributes

      Map<String,Object> getAttributes()
      Returns attributes for the current search result.
      Returns:
      the attributes