Package org.ametys.cms.search.solr
Class SolrQuerySearchAction
- java.lang.Object
- 
- org.apache.avalon.framework.logger.AbstractLogEnabled
- 
- org.apache.cocoon.acting.AbstractAction
- 
- org.apache.cocoon.acting.ServiceableAction
- 
- org.ametys.cms.search.cocoon.SearchAction
- 
- org.ametys.cms.search.solr.SolrQuerySearchAction
 
 
 
 
 
- 
- All Implemented Interfaces:
- Component,- Contextualizable,- LogEnabled,- Serviceable,- Action
 
 public class SolrQuerySearchAction extends SearchAction Execute a solr query with custom columns and facets.
- 
- 
Field SummaryFields Modifier and Type Field Description protected ColumnHelper_columnHelperThe helper for columnsprotected ContentTypesHelper_contentTypesHelperThe content types helper.- 
Fields inherited from class org.ametys.cms.search.cocoon.SearchAction_contentTypeExtensionPoint, _context, _getQueryFromJSONHelper, _queryBuilder, _searcherFactory, _searchModelManager, _serverCommHelper, QUERY_ERROR, SEARCH_CONTENTS, SEARCH_LOCALE, SEARCH_MODEL, SEARCH_RESULTS
 - 
Fields inherited from class org.apache.cocoon.acting.ServiceableActionmanager
 - 
Fields inherited from class org.apache.cocoon.acting.AbstractActionEMPTY_MAP
 
- 
 - 
Constructor SummaryConstructors Constructor Description SolrQuerySearchAction()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private Collection<ColumnHelper.Column>_getColumns(String columnsStr, Set<String> baseContentTypeIds)static StringbuildQuery(QueryBuilder queryBuilder, String baseQuery, Set<String> contentTypesOrMixins, Set<Integer> wfSteps)Build a Solr query string from inputs coming from a SolrQuerySearch (query, content types, workflow steps)protected voiddoSearch(Request request, SearchUIModel model, int offset, int maxResults, Map<String,Object> jsParameters, Map<String,Object> contextualParameters)Do the search and set the results in request attributes.static Set<String>getContentTypes(Map<String,Object> jsParameters)Gets the content types from JS parameters when using 'search-ui.solr' modelvoidservice(ServiceManager serviceManager)The searcher- 
Methods inherited from class org.ametys.cms.search.cocoon.SearchActionact, contextualize, getMaxResults, getOffset, getSearchUIModel, getSort
 - 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabledenableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
- 
 
- 
- 
- 
Field Detail- 
_contentTypesHelperprotected ContentTypesHelper _contentTypesHelper The content types helper.
 - 
_columnHelperprotected ColumnHelper _columnHelper The helper for columns
 
- 
 - 
Constructor Detail- 
SolrQuerySearchActionpublic SolrQuerySearchAction() 
 
- 
 - 
Method Detail- 
servicepublic void service(ServiceManager serviceManager) throws ServiceException The searcher- Specified by:
- servicein interface- Serviceable
- Overrides:
- servicein class- SearchAction
- Throws:
- ServiceException
 
 - 
doSearchprotected void doSearch(Request request, SearchUIModel model, int offset, int maxResults, Map<String,Object> jsParameters, Map<String,Object> contextualParameters) throws Exception Description copied from class:SearchActionDo the search and set the results in request attributes.- Overrides:
- doSearchin class- SearchAction
- Parameters:
- request- The request. The results or contents' id have to be set in request attributes
- model- The search UI model
- offset- The index of search
- maxResults- The max results
- jsParameters- The JS parameters
- contextualParameters- The contextual parameters
- Throws:
- Exception- if the search failed
 
 - 
_getColumnsprivate Collection<ColumnHelper.Column> _getColumns(String columnsStr, Set<String> baseContentTypeIds) 
 - 
getContentTypespublic static Set<String> getContentTypes(Map<String,Object> jsParameters) Gets the content types from JS parameters when using 'search-ui.solr' model- Parameters:
- jsParameters- The JS parameters
- Returns:
- The content types
 
 - 
buildQuerypublic static String buildQuery(QueryBuilder queryBuilder, String baseQuery, Set<String> contentTypesOrMixins, Set<Integer> wfSteps) throws QuerySyntaxException Build a Solr query string from inputs coming from a SolrQuerySearch (query, content types, workflow steps)- Parameters:
- queryBuilder- The- QueryBuildercomponent
- baseQuery- The main query
- contentTypesOrMixins- The content types -or mixins- (can be empty)
- wfSteps- The workflow steps (can be empty)
- Returns:
- The built query
- Throws:
- QuerySyntaxException- If a query syntax is invalid
 
 
- 
 
-