Interface SearchResult
-
- All Known Implementing Classes:
SolrSearchResult
public interface SearchResult
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontainsFacet(java.lang.String name)Checks if the specified name is a facet.java.util.Map<java.lang.String,java.lang.Object>getAttributes()Returns attributes for the current search result.java.util.List<IndexedTypeSort>getAvailableNamedSorts()Return list of available named sorts.java.util.List<Breadcrumb>getBreadcrumbs()Return bread-crumbs for the current search result state.IndexedTypeSortgetCurrentNamedSort()Return currently selected sort.java.util.List<Document>getDocuments()Returns the document that represent the main results.FacetgetFacet(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)java.util.Set<java.lang.String>getFacetNames()Searches for all root facet names.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]java.util.List<SearchResultGroupCommand>getGroupCommands()Returns the group results.java.util.List<java.lang.String>getIdentifiers()Searches for the identifiers saved in the index, for example, "sony_online", "ati_staged", or "just_name"java.util.List<KeywordRedirectValue>getKeywordRedirects()longgetNumberOfPages()Use for paginationlonggetNumberOfResults()Returns the number of results.intgetOffset()Use for paginationintgetPageSize()Use for paginationSearchQueryInfogetQueryInfo()Statistics Info about the Search Query - usable for loggingjava.util.List<java.lang.String>getResultCodes()Searches for item's codes.<T> java.util.List<T>getResultData(ConverterType converterType)Returns SOLR results in form of a simple data objects (DTO's)java.util.List<PK>getResultPKs()Searches for all result PKs.java.util.List<? extends ItemModel>getResults()Searches for all result items.org.apache.solr.client.solrj.response.QueryResponsegetSolrObject()Searches for the underlying implementation.java.lang.StringgetSpellingSuggestion()Get the best suggestion from the spellchecker.booleanhasNext()Use for paginationbooleanhasPrevious()Use for pagination
-
-
-
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
-
getResultPKs
java.util.List<PK> getResultPKs() throws FacetSearchException
Searches for all result PKs.- Returns:
- resulting items PK
- Throws:
FacetSearchException
-
getResultCodes
java.util.List<java.lang.String> getResultCodes() throws FacetSearchExceptionSearches for item's codes.- Returns:
- List items codes as Strings
- Throws:
FacetSearchException
-
getResults
java.util.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> 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.
-
getKeywordRedirects
java.util.List<KeywordRedirectValue> getKeywordRedirects()
-
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
-
-