Interface SearchResult
- All Known Implementing Classes:
SolrSearchResult
public interface SearchResult
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsFacet(String name) Checks if the specified name is a facet.Returns attributes for the current search result.Return list of available named sorts.Return bread-crumbs for the current search result state.Return currently selected sort.Returns the document that represent the main results.Searches for the root of a facet tree which contains the Facet and all FacetValues, for example, manufacturers(Facet) contains [eizo, ati, ..](FacetValue)Searches for all root facet names.Searches for all available facets which contain the whole tree, manufacturers [eizo, ati, ..], prices [100-499,500-999],categories [online, staged]Returns the group command result.Deprecated, for removal: This API element is subject to removal in a future version.Searches for the identifiers saved in the index, for example, "sony_online", "ati_staged", or "just_name"longUse for paginationlongReturns the number of results.intUse for paginationintUse for paginationStatistics Info about the Search Query - usable for loggingSearches for item's codes.<T> List<T>getResultData(ConverterType converterType) Returns SOLR results in form of a simple data objects (DTO's)Searches for all result PKs.Searches for all result items.org.apache.solr.client.solrj.response.QueryResponseSearches for the underlying implementation.Get the best suggestion from the spellchecker.booleanhasNext()Use for paginationbooleanUse for paginationvoidsetGroupCommandResult(SearchResultGroupCommand groupCommandResult) Sets the group command result.
-
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
Searches for the identifiers saved in the index, for example, "sony_online", "ati_staged", or "just_name"- Returns:
- collection of all identifiers
-
getResultPKs
Searches for all result PKs.- Returns:
- resulting items PK
- Throws:
FacetSearchException
-
getResultCodes
Searches for item's codes.- Returns:
- List items codes as Strings
- Throws:
FacetSearchException
-
getResults
Searches for all result items. Example, [product_01, product_02], or [cms_01, cms_02, cms_03]- Returns:
- all items
- Throws:
FacetSearchException
-
getResultData
Returns SOLR results in form of a simple data objects (DTO's) -
getDocuments
Returns the document that represent the main results.- Returns:
- the documents
-
setGroupCommandResult
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, for removal: This API element is subject to removal in a future version.Replaced bysetGroupCommandResult(SearchResultGroupCommand)andgetGroupCommandResult().Returns the group results.- Returns:
- the group results
-
getFacetNames
Searches for all root facet names. Example: [manufacturers, prices, categories]- Returns:
- all root facet names
-
containsFacet
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
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
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
Returns attributes for the current search result.- Returns:
- the attributes
-
setGroupCommandResult(SearchResultGroupCommand)andgetGroupCommandResult().