Class SolrSearchResult

java.lang.Object
de.hybris.platform.solrfacetsearch.search.impl.SolrSearchResult
All Implemented Interfaces:
SearchResult, Serializable

public class SolrSearchResult extends Object implements SearchResult, Serializable
See Also:
  • Constructor Details

    • SolrSearchResult

      public SolrSearchResult()
  • Method Details

    • getConvertersMapping

      public ConvertersMapping getConvertersMapping()
    • setConvertersMapping

      public void setConvertersMapping(ConvertersMapping convertersMapping)
    • getSearchQuery

      public SearchQuery getSearchQuery()
    • setSearchQuery

      public void setSearchQuery(SearchQuery searchQuery)
    • getQueryResponse

      public org.apache.solr.client.solrj.response.QueryResponse getQueryResponse()
    • setQueryResponse

      public void setQueryResponse(org.apache.solr.client.solrj.response.QueryResponse queryResponse)
    • getNumberOfResults

      public long getNumberOfResults()
      Description copied from interface: SearchResult
      Returns the number of results. If result grouping is being used, this is the number of groups.
      Specified by:
      getNumberOfResults in interface SearchResult
      Returns:
      the number of results
    • setNumberOfResults

      public void setNumberOfResults(long numberOfResults)
    • getDocuments

      public List<Document> getDocuments()
      Description copied from interface: SearchResult
      Returns the document that represent the main results.
      Specified by:
      getDocuments in interface SearchResult
      Returns:
      the documents
    • setDocuments

      public void setDocuments(List<Document> documents)
    • getSolrDocuments

      public List<org.apache.solr.common.SolrDocument> getSolrDocuments()
    • setSolrDocuments

      public void setSolrDocuments(List<org.apache.solr.common.SolrDocument> solrDocuments)
    • setGroupCommandResult

      public void setGroupCommandResult(SearchResultGroupCommand groupCommandResult)
      Description copied from interface: SearchResult
      Sets the group command result.
      Specified by:
      setGroupCommandResult in interface SearchResult
      Parameters:
      groupCommandResult - - the group command result
    • getGroupCommandResult

      public SearchResultGroupCommand getGroupCommandResult()
      Description copied from interface: SearchResult
      Returns the group command result.
      Specified by:
      getGroupCommandResult in interface SearchResult
      Returns:
      the group command result
    • getGroupCommands

      public List<SearchResultGroupCommand> getGroupCommands()
      Description copied from interface: SearchResult
      Returns the group results.
      Specified by:
      getGroupCommands in interface SearchResult
      Returns:
      the group results
    • setGroupCommands

      public void setGroupCommands(List<SearchResultGroupCommand> groupCommands)
    • getFacetsMap

      public Map<String,Facet> getFacetsMap()
    • setFacetsMap

      public void setFacetsMap(Map<String,Facet> facets)
    • getBreadcrumbs

      public List<Breadcrumb> getBreadcrumbs()
      Description copied from interface: SearchResult
      Return bread-crumbs for the current search result state.
      Specified by:
      getBreadcrumbs in interface SearchResult
      Returns:
      List of Breadcrumb
    • setBreadcrumbs

      public void setBreadcrumbs(List<Breadcrumb> breadcrumbs)
    • getKeywordRedirects

      public List<KeywordRedirectValue> getKeywordRedirects()
      Specified by:
      getKeywordRedirects in interface SearchResult
    • getAvailableNamedSorts

      public List<IndexedTypeSort> getAvailableNamedSorts()
      Description copied from interface: SearchResult
      Return list of available named sorts.
      Specified by:
      getAvailableNamedSorts in interface SearchResult
      Returns:
      List of IndexedTypeSort
    • setAvailableNamedSorts

      public void setAvailableNamedSorts(List<IndexedTypeSort> availableNamedSorts)
    • getCurrentNamedSort

      public IndexedTypeSort getCurrentNamedSort()
      Description copied from interface: SearchResult
      Return currently selected sort.
      Specified by:
      getCurrentNamedSort in interface SearchResult
      Returns:
      current sort
    • setCurrentNamedSort

      public void setCurrentNamedSort(IndexedTypeSort currentNamedSort)
    • setKeywordRedirects

      public void setKeywordRedirects(List<KeywordRedirectValue> keywordRedirects)
    • getFacetSearchConfig

      public FacetSearchConfig getFacetSearchConfig()
    • getIndexedType

      public IndexedType getIndexedType()
    • getOffset

      public int getOffset()
      Description copied from interface: SearchResult
      Use for pagination
      Specified by:
      getOffset in interface SearchResult
      Returns:
      the offset of the pages, 0 for the first page, 1 for the second, and so on
    • getPageSize

      public int getPageSize()
      Description copied from interface: SearchResult
      Use for pagination
      Specified by:
      getPageSize in interface SearchResult
      Returns:
      size of the page
    • hasNext

      public boolean hasNext()
      Description copied from interface: SearchResult
      Use for pagination
      Specified by:
      hasNext in interface SearchResult
      Returns:
      true if the next page is available, false otherwise.
    • hasPrevious

      public boolean hasPrevious()
      Description copied from interface: SearchResult
      Use for pagination
      Specified by:
      hasPrevious in interface SearchResult
      Returns:
      true if the previous page is available, false otherwise.
    • getNumberOfPages

      public long getNumberOfPages()
      Description copied from interface: SearchResult
      Use for pagination
      Specified by:
      getNumberOfPages in interface SearchResult
      Returns:
      number of pages
    • getIdentifiers

      public List<String> getIdentifiers()
      Description copied from interface: SearchResult
      Searches for the identifiers saved in the index, for example, "sony_online", "ati_staged", or "just_name"
      Specified by:
      getIdentifiers in interface SearchResult
      Returns:
      collection of all identifiers
    • getResultPKs

      public List<PK> getResultPKs() throws FacetSearchException
      Description copied from interface: SearchResult
      Searches for all result PKs.
      Specified by:
      getResultPKs in interface SearchResult
      Returns:
      resulting items PK
      Throws:
      FacetSearchException
    • getResultCodes

      public List<String> getResultCodes() throws FacetSearchException
      Description copied from interface: SearchResult
      Searches for item's codes.
      Specified by:
      getResultCodes in interface SearchResult
      Returns:
      List items codes as Strings
      Throws:
      FacetSearchException
    • getResults

      public List<? extends ItemModel> getResults() throws FacetSearchException
      Description copied from interface: SearchResult
      Searches for all result items. Example, [product_01, product_02], or [cms_01, cms_02, cms_03]
      Specified by:
      getResults in interface SearchResult
      Returns:
      all items
      Throws:
      FacetSearchException
    • getResultData

      public <T> List<T> getResultData(ConverterType converterType)
      Description copied from interface: SearchResult
      Returns SOLR results in form of a simple data objects (DTO's)
      Specified by:
      getResultData in interface SearchResult
      Returns:
      unmodifiable, lazy list of search result DTO's
      Throws:
      IllegalStateException - when no converter was registered for result type or query was not passed in the constructor
    • addFacet

      public void addFacet(Facet facet)
    • getFacetNames

      public Set<String> getFacetNames()
      Description copied from interface: SearchResult
      Searches for all root facet names. Example: [manufacturers, prices, categories]
      Specified by:
      getFacetNames in interface SearchResult
      Returns:
      all root facet names
    • containsFacet

      public boolean containsFacet(String name)
      Description copied from interface: SearchResult
      Checks if the specified name is a facet. For example, manufacturers --> true, admin --> false
      Specified by:
      containsFacet in interface SearchResult
      Parameters:
      name - name of the root facet
      Returns:
      true if found, false otherwise
    • getFacet

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

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

      public String getSpellingSuggestion()
      Description copied from interface: SearchResult
      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.
      Specified by:
      getSpellingSuggestion in interface SearchResult
    • getQueryInfo

      public SearchQueryInfo getQueryInfo()
      Description copied from interface: SearchResult
      Statistics Info about the Search Query - usable for logging
      Specified by:
      getQueryInfo in interface SearchResult
    • getSolrObject

      public org.apache.solr.client.solrj.response.QueryResponse getSolrObject()
      Description copied from interface: SearchResult
      Searches for the underlying implementation.
      Specified by:
      getSolrObject in interface SearchResult
      Returns:
      The result object of the underlying implementation.
    • getAttributes

      public Map<String,Object> getAttributes()
      Description copied from interface: SearchResult
      Returns attributes for the current search result.
      Specified by:
      getAttributes in interface SearchResult
      Returns:
      the attributes
    • getConverter

      protected Converter getConverter(ConverterType converterType)
    • getModelLoader

      protected ModelLoader getModelLoader(IndexedType indexType)