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
public class FrontOfficeSearcherFactory.FrontOfficeSearcher extends SearcherFactory.Searcher
Searcher forAbstractSearchGenerator
-
-
Field Summary
Fields Modifier and Type Field Description private Collection<FrontOfficeSearcherFactory.QueryFacet>
_queryFacets
private Collection<String>
_queryFacetValues
-
Constructor Summary
Constructors Modifier Constructor Description protected
FrontOfficeSearcher(org.slf4j.Logger logger)
Build a Searcher with default values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A extends AmetysObject>
SearchResults<A>_buildResults(org.apache.solr.client.solrj.response.QueryResponse response, List<SearchField> facets)
From the Solr server response, builds theSearchResults
object.protected void
modifySolrQuery(org.apache.solr.client.solrj.SolrQuery query)
Template method to do additional operations on the Solr query before passing it to the Solr clientFrontOfficeSearcherFactory.FrontOfficeSearcher
withQueryFacets(Collection<FrontOfficeSearcherFactory.QueryFacet> queryFacets)
Sets the query facets (facet.query parameters)FrontOfficeSearcherFactory.FrontOfficeSearcher
withQueryFacetValues(Collection<String> queryFacetValues)
Set the facet.query values-
Methods 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, withLimits, withQuery, withQueryString, withSort, withSort
-
-
-
-
Field Detail
-
_queryFacets
private Collection<FrontOfficeSearcherFactory.QueryFacet> _queryFacets
-
_queryFacetValues
private Collection<String> _queryFacetValues
-
-
Constructor Detail
-
FrontOfficeSearcher
protected FrontOfficeSearcher(org.slf4j.Logger logger)
Build a Searcher with default values.- Parameters:
logger
- The logger.
-
-
Method Detail
-
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.SolrQuery query)
Description copied from class:SearcherFactory.Searcher
Template method to do additional operations on the Solr query before passing it to the Solr client- Overrides:
modifySolrQuery
in classSearcherFactory.Searcher
- Parameters:
query
- the Solr query
-
_buildResults
public <A extends AmetysObject> SearchResults<A> _buildResults(org.apache.solr.client.solrj.response.QueryResponse response, List<SearchField> facets) throws Exception
Description copied from class:SearcherFactory.Searcher
From the Solr server response, builds theSearchResults
object.- Overrides:
_buildResults
in 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.
-
-