Class SolrSearchResult

    • Constructor Detail

      • SolrSearchResult

        public SolrSearchResult()
    • Method Detail

      • setConvertersMapping

        public void setConvertersMapping​(ConvertersMapping convertersMapping)
      • 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 java.util.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​(java.util.List<Document> documents)
      • getSolrDocuments

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

        public void setSolrDocuments​(java.util.List<org.apache.solr.common.SolrDocument> solrDocuments)
      • getFacetsMap

        public java.util.Map<java.lang.String,​Facet> getFacetsMap()
      • setFacetsMap

        public void setFacetsMap​(java.util.Map<java.lang.String,​Facet> facets)
      • setBreadcrumbs

        public void setBreadcrumbs​(java.util.List<Breadcrumb> breadcrumbs)
      • setAvailableNamedSorts

        public void setAvailableNamedSorts​(java.util.List<IndexedTypeSort> availableNamedSorts)
      • setCurrentNamedSort

        public void setCurrentNamedSort​(IndexedTypeSort currentNamedSort)
      • setKeywordRedirects

        public void setKeywordRedirects​(java.util.List<KeywordRedirectValue> keywordRedirects)
      • 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 java.util.List<java.lang.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
      • getResultData

        public <T> java.util.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:
        java.lang.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 java.util.Set<java.lang.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​(java.lang.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​(java.lang.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 java.util.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 java.lang.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
      • 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 java.util.Map<java.lang.String,​java.lang.Object> getAttributes()
        Description copied from interface: SearchResult
        Returns attributes for the current search result.
        Specified by:
        getAttributes in interface SearchResult
        Returns:
        the attributes