Interface SearchResult

  • All Known Implementing Classes:
    SolrSearchResult

    public interface SearchResult
    • Method Detail

      • 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

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

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

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

        java.util.List<SearchResultGroupCommand> getGroupCommands()
        Returns the group results.
        Returns:
        the group results
      • getFacetNames

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

        boolean containsFacet​(java.lang.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​(java.lang.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

        java.util.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

        java.lang.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.
      • getAvailableNamedSorts

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

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

        java.util.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

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