Package org.opencms.jsp.search.result
Class CmsSearchResultWrapper
java.lang.Object
org.opencms.jsp.search.result.CmsSearchResultWrapper
- All Implemented Interfaces:
I_CmsSearchResultWrapper
Wrapper for the whole search result. Also allowing to access the search form controller.
-
Constructor Summary
ConstructorDescriptionCmsSearchResultWrapper
(I_CmsSearchControllerMain controller, CmsSolrResultList resultList, CmsSolrQuery query, CmsObject cms, CmsSearchException exception) Constructor taking the main search form controller and the result list as normally returned. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
convertSearchResults
(Collection<CmsSearchResource> searchResults) Converts the search results from CmsSearchResource to CmsSearchResourceBean.Returns the main controller for the search form.Returns the "Did you mean ...?" suggestion - if did you mean is enabled.org.apache.solr.client.solrj.response.SpellCheckResponse.Suggestion
Returns the suggestion of "Did you mean ...?" for the complete query - if did you mean is enabled.Returns the empty search state parameters.int
getEnd()
Returns the last index of the documents displayed.Returns the search exception if search fails.Returns the result of the query facet, i.e., the map from queries to the number of hits.Returns the map for field facet names to the search result part for that field facet.Collection<org.apache.solr.client.solrj.response.FacetField>
Returns the collection of the search result parts for the field facets.Returns the query object as send to Solr.Returns the map from the document ids to the corresponding highlighting results (as map from the highlighted field to the highlighted snippets).Returns the maximal score of the found documents.Returns for the specified facet (key) the selected facet entries that are not part of the returned facet entries are provided (value).Returns the selected facet entries that are not part of the returned facet entries are provided (value).Returns for the specified facet (key) the selected facet entries that are not part of the returned facet entries are provided (value).long
Returns the number of resources that where found.long
Returns the number of maximally returned results, this is the minimum of the number of found resultsI_CmsSearchResultWrapper.getNumFound()
and the number of results maximally processedI_CmsSearchConfigurationCommon.getMaxReturnedResults()
int
Returns the number of pages necessary to show all search results.int
Returns the number of the fist page that should be shown in a "Google"-like page navigation.int
Returns the number of the last page that should be shown in a "Google"-like page navigation.Returns the map for range facet names to the search result part for that range facet.Collection<org.apache.solr.client.solrj.response.RangeFacet>
Returns the collection of the search result parts for the range facets.Returns the collection of the search results that are returned by Solr.getStart()
Returns the index (starting at 1) of the first result that is returned for displaying.Returns the current search state parameters.
-
Constructor Details
-
CmsSearchResultWrapper
public CmsSearchResultWrapper(I_CmsSearchControllerMain controller, CmsSolrResultList resultList, CmsSolrQuery query, CmsObject cms, CmsSearchException exception) Constructor taking the main search form controller and the result list as normally returned.- Parameters:
controller
- The main search form controller.resultList
- The result list as returned from OpenCms' embedded Solr server.query
- The complete query send to Solr.cms
- The Cms object used to access XML contents, if wanted.exception
- Search exception, ornull
if no exception occurs.
-
-
Method Details
-
getController
Description copied from interface:I_CmsSearchResultWrapper
Returns the main controller for the search form.- Specified by:
getController
in interfaceI_CmsSearchResultWrapper
- Returns:
- The main controller for the search form.
- See Also:
-
getDidYouMeanCollated
Description copied from interface:I_CmsSearchResultWrapper
Returns the "Did you mean ...?" suggestion - if did you mean is enabled.- Specified by:
getDidYouMeanCollated
in interfaceI_CmsSearchResultWrapper
- Returns:
- The "Did you mean ...?" suggestion - if did you mean is enabled.
- See Also:
-
getDidYouMeanSuggestion
public org.apache.solr.client.solrj.response.SpellCheckResponse.Suggestion getDidYouMeanSuggestion()Description copied from interface:I_CmsSearchResultWrapper
Returns the suggestion of "Did you mean ...?" for the complete query - if did you mean is enabled.- Specified by:
getDidYouMeanSuggestion
in interfaceI_CmsSearchResultWrapper
- Returns:
- The suggestion of "Did you mean ...?" for the complete query - if did you mean is enabled.
- See Also:
-
getEmptyStateParameters
Description copied from interface:I_CmsSearchResultWrapper
Returns the empty search state parameters. Use the function to generate just part of the state parameters, instead of manipulating the current state.- Specified by:
getEmptyStateParameters
in interfaceI_CmsSearchResultWrapper
- Returns:
- The empty search state parameters.
- See Also:
-
getEnd
Description copied from interface:I_CmsSearchResultWrapper
Returns the last index of the documents displayed.- Specified by:
getEnd
in interfaceI_CmsSearchResultWrapper
- Returns:
- The last index of the documents displayed.
- See Also:
-
getException
Description copied from interface:I_CmsSearchResultWrapper
Returns the search exception if search fails.- Specified by:
getException
in interfaceI_CmsSearchResultWrapper
- Returns:
- The exception thrown by Solr, or
null
if the search succeeds. - See Also:
-
getFacetQuery
Description copied from interface:I_CmsSearchResultWrapper
Returns the result of the query facet, i.e., the map from queries to the number of hits.- Specified by:
getFacetQuery
in interfaceI_CmsSearchResultWrapper
- Returns:
- The result of the query facet, i.e., the map from queries to the number of hits.
- See Also:
-
getFieldFacet
Description copied from interface:I_CmsSearchResultWrapper
Returns the map for field facet names to the search result part for that field facet.- Specified by:
getFieldFacet
in interfaceI_CmsSearchResultWrapper
- Returns:
- The map for field facet names to the search result part for that field facet.
- See Also:
-
getFieldFacets
Description copied from interface:I_CmsSearchResultWrapper
Returns the collection of the search result parts for the field facets.- Specified by:
getFieldFacets
in interfaceI_CmsSearchResultWrapper
- Returns:
- The collection of the search result parts for the field facets.
- See Also:
-
getFinalQuery
Description copied from interface:I_CmsSearchResultWrapper
Returns the query object as send to Solr.- Specified by:
getFinalQuery
in interfaceI_CmsSearchResultWrapper
- Returns:
- The query object as send to Solr.
- See Also:
-
getHighlighting
Description copied from interface:I_CmsSearchResultWrapper
Returns the map from the document ids to the corresponding highlighting results (as map from the highlighted field to the highlighted snippets).- Specified by:
getHighlighting
in interfaceI_CmsSearchResultWrapper
- Returns:
- The map from the document ids to the corresponding highlighting results (as map from the highlighted field to the highlighted snippets).
- See Also:
-
getMaxScore
Description copied from interface:I_CmsSearchResultWrapper
Returns the maximal score of the found documents.- Specified by:
getMaxScore
in interfaceI_CmsSearchResultWrapper
- Returns:
- The maximal score of the found documents.
- See Also:
-
getMissingSelectedFieldFacetEntries
Description copied from interface:I_CmsSearchResultWrapper
Returns for the specified facet (key) the selected facet entries that are not part of the returned facet entries are provided (value).- Specified by:
getMissingSelectedFieldFacetEntries
in interfaceI_CmsSearchResultWrapper
- Returns:
- For the specified facet (key) the selected facet entries that are not part of the returned facet entries are provided (value).
- See Also:
-
getMissingSelectedQueryFacetEntries
Description copied from interface:I_CmsSearchResultWrapper
Returns the selected facet entries that are not part of the returned facet entries are provided (value).- Specified by:
getMissingSelectedQueryFacetEntries
in interfaceI_CmsSearchResultWrapper
- Returns:
- The selected facet entries that are not part of the returned facet entries are provided (value).
- See Also:
-
getMissingSelectedRangeFacetEntries
Description copied from interface:I_CmsSearchResultWrapper
Returns for the specified facet (key) the selected facet entries that are not part of the returned facet entries are provided (value).- Specified by:
getMissingSelectedRangeFacetEntries
in interfaceI_CmsSearchResultWrapper
- Returns:
- For the specified facet (key) the selected facet entries that are not part of the returned facet entries are provided (value).
- See Also:
-
getNumFound
Description copied from interface:I_CmsSearchResultWrapper
Returns the number of resources that where found.- Specified by:
getNumFound
in interfaceI_CmsSearchResultWrapper
- Returns:
- The number of resources that where found.
- See Also:
-
getNumMaxReturned
Description copied from interface:I_CmsSearchResultWrapper
Returns the number of maximally returned results, this is the minimum of the number of found resultsI_CmsSearchResultWrapper.getNumFound()
and the number of results maximally processedI_CmsSearchConfigurationCommon.getMaxReturnedResults()
- Specified by:
getNumMaxReturned
in interfaceI_CmsSearchResultWrapper
- Returns:
- the number of maximally returned results.
- See Also:
-
getNumPages
Description copied from interface:I_CmsSearchResultWrapper
Returns the number of pages necessary to show all search results.- Specified by:
getNumPages
in interfaceI_CmsSearchResultWrapper
- Returns:
- The number of pages necessary to show all search results.
- See Also:
-
getRangeFacet
Description copied from interface:I_CmsSearchResultWrapper
Returns the map for range facet names to the search result part for that range facet.- Specified by:
getRangeFacet
in interfaceI_CmsSearchResultWrapper
- Returns:
- The map for range facet names to the search result part for that range facet.
- See Also:
-
getRangeFacets
Description copied from interface:I_CmsSearchResultWrapper
Returns the collection of the search result parts for the range facets.- Specified by:
getRangeFacets
in interfaceI_CmsSearchResultWrapper
- Returns:
- The collection of the search result parts for the range facets.
- See Also:
-
getSearchResults
Description copied from interface:I_CmsSearchResultWrapper
Returns the collection of the search results that are returned by Solr.- Specified by:
getSearchResults
in interfaceI_CmsSearchResultWrapper
- Returns:
- The collection of the search results that are returned by Solr.
- See Also:
-
getStart
Description copied from interface:I_CmsSearchResultWrapper
Returns the index (starting at 1) of the first result that is returned for displaying.- Specified by:
getStart
in interfaceI_CmsSearchResultWrapper
- Returns:
- The index (starting at 1) of the first result that is returned for displaying.
- See Also:
-
getStateParameters
Description copied from interface:I_CmsSearchResultWrapper
Returns the current search state parameters.- Specified by:
getStateParameters
in interfaceI_CmsSearchResultWrapper
- Returns:
- The current search state parameters.
- See Also:
-
convertSearchResults
Converts the search results from CmsSearchResource to CmsSearchResourceBean.- Parameters:
searchResults
- The collection of search results to transform.
-