Package org.ametys.web.frontoffice
Class FrontOfficeSearcherFactory.FrontOfficeSearcher
java.lang.Object
org.ametys.cms.search.solr.SearcherFactory.Searcher
org.ametys.web.frontoffice.FrontOfficeSearcherFactory.FrontOfficeSearcher
- Enclosing class:
FrontOfficeSearcherFactory
Searcher for
AbstractSearchGenerator-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFrontOfficeSearcher(org.slf4j.Logger logger) Build a Searcher with default values. -
Method Summary
Modifier and TypeMethodDescription<A extends AmetysObject>
SearchResults<A> _buildResults(org.apache.solr.client.solrj.response.QueryResponse response, List<SearcherFactory.FacetDefinition> facets) From the Solr server response, builds theSearchResultsobject.protected voidmodifySolrQuery(org.apache.solr.client.solrj.request.json.JsonQueryRequest solrQuery) Template method to do additional operations on the Solr query before passing it to the Solr clientwithQueryFacets(Collection<FrontOfficeSearcherFactory.QueryFacet> queryFacets) Sets the query facets (facet.query parameters)withQueryFacetValues(Collection<String> queryFacetValues) Set the facet.query valuesMethods inherited from class org.ametys.cms.search.solr.SearcherFactory.Searcher
addContextElement, addFacet, addFilterQuery, addFilterQueryString, addSort, checkRightsComparingTo, getFacetResults, getFilterQueries, getQuery, getSolrQuery, search, searchWithFacets, setCheckRights, setDebugOn, setFacets, setSort, withContext, withFacets, withFacets, withFacetValues, withFilterQueries, withFilterQueries, withFilterQueryStrings, withFilterQueryStrings, withHighlight, withHighlightingQuery, withLimits, withQuery, withQueryString, withSort, withSort
-
Constructor Details
-
FrontOfficeSearcher
Build a Searcher with default values.- Parameters:
logger- The logger.
-
-
Method Details
-
withQueryFacets
public FrontOfficeSearcherFactory.FrontOfficeSearcher withQueryFacets(Collection<FrontOfficeSearcherFactory.QueryFacet> queryFacets) Sets the query facets (facet.query parameters)- Parameters:
queryFacets- The facets- Returns:
- The Searcher object itself.
-
withQueryFacetValues
public FrontOfficeSearcherFactory.FrontOfficeSearcher withQueryFacetValues(Collection<String> queryFacetValues) Set the facet.query values- Parameters:
queryFacetValues- The values- Returns:
- The Searcher object itself.
-
modifySolrQuery
protected void modifySolrQuery(org.apache.solr.client.solrj.request.json.JsonQueryRequest solrQuery) Description copied from class:SearcherFactory.SearcherTemplate method to do additional operations on the Solr query before passing it to the Solr client- Overrides:
modifySolrQueryin classSearcherFactory.Searcher- Parameters:
solrQuery- the Solr query
-
_buildResults
public <A extends AmetysObject> SearchResults<A> _buildResults(org.apache.solr.client.solrj.response.QueryResponse response, List<SearcherFactory.FacetDefinition> facets) throws Exception Description copied from class:SearcherFactory.SearcherFrom the Solr server response, builds theSearchResultsobject.- Overrides:
_buildResultsin classSearcherFactory.Searcher- Type Parameters:
A- The type of search results- Parameters:
response- The response from the Solr serverfacets- The facet fields to return- Returns:
- An iterable on the search result objects.
- Throws:
Exception- If an error occurs.
-