Package org.ametys.cms.search.solr
Class SolrQueryHelper
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.search.solr.SolrQueryHelper
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
public class SolrQueryHelper extends AbstractLogEnabled implements Component, Serviceable
Helper for solr query editor.
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentTypesHelper
_contentTypesHelper
The content types helper.protected ContentTypeExtensionPoint
_cTypeEP
The content type extension point.protected SearchUIModelExtensionPoint
_searchModelManager
The search model helper.protected SystemPropertyExtensionPoint
_systemPropertyEP
The extension point for system propertiesstatic String
ROLE
The component role.
-
Constructor Summary
Constructors Constructor Description SolrQueryHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
_isFacetable(MetadataDefinition metaDef)
private void
_putCompositeMetadata(Map<String,Object> properties, MetadataDefinition metaDef, String cTypeId, String language)
private void
_putContentType(Map<String,Object> contentTypes, ContentType contentType, String language)
private void
_putIndexingField(Map<String,Object> metadata, IndexingField field, String language)
private void
_putMetadataIndexingField(Map<String,Object> fields, String name, MetadataDefinition metaDef, String cTypeId, String language)
private void
_putReferenceField(Map<String,Object> fields, String name, String refField, String refCTypeId)
private void
_putSimpleMetadata(Map<String,Object> properties, MetadataDefinition metaDef, String language)
private void
_putTitleMetadata(Map<String,Object> systemProps, String language)
Map<String,Object>
getAllContentTypeIndexingFields(String language)
Get all the content types and their indexing fields.Map<String,Object>
getCommonAncestors(Collection<String> contentTypes)
Get content types' common ancestors.Map<String,Object>
getCommonFields(String language)
Get the common fields.void
service(ServiceManager serviceManager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_cTypeEP
protected ContentTypeExtensionPoint _cTypeEP
The content type extension point.
-
_contentTypesHelper
protected ContentTypesHelper _contentTypesHelper
The content types helper.
-
_searchModelManager
protected SearchUIModelExtensionPoint _searchModelManager
The search model helper.
-
_systemPropertyEP
protected SystemPropertyExtensionPoint _systemPropertyEP
The extension point for system properties
-
-
Constructor Detail
-
SolrQueryHelper
public SolrQueryHelper()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getAllContentTypeIndexingFields
public Map<String,Object> getAllContentTypeIndexingFields(String language)
Get all the content types and their indexing fields.- Parameters:
language
- the query language (because string field names are language-dependent).- Returns:
- the content types and their metadatas.
-
_putContentType
private void _putContentType(Map<String,Object> contentTypes, ContentType contentType, String language)
-
_putIndexingField
private void _putIndexingField(Map<String,Object> metadata, IndexingField field, String language)
-
_putMetadataIndexingField
private void _putMetadataIndexingField(Map<String,Object> fields, String name, MetadataDefinition metaDef, String cTypeId, String language)
-
_putCompositeMetadata
private void _putCompositeMetadata(Map<String,Object> properties, MetadataDefinition metaDef, String cTypeId, String language)
-
_putSimpleMetadata
private void _putSimpleMetadata(Map<String,Object> properties, MetadataDefinition metaDef, String language)
-
_isFacetable
private boolean _isFacetable(MetadataDefinition metaDef)
-
_putReferenceField
private void _putReferenceField(Map<String,Object> fields, String name, String refField, String refCTypeId)
-
getCommonAncestors
public Map<String,Object> getCommonAncestors(Collection<String> contentTypes)
Get content types' common ancestors.- Parameters:
contentTypes
- The content types.- Returns:
- a Map with the common ancestors
-
getCommonFields
public Map<String,Object> getCommonFields(String language)
Get the common fields.- Parameters:
language
- the query language (because string field names are language-dependent).- Returns:
- the common fields.
-
_putTitleMetadata
private void _putTitleMetadata(Map<String,Object> systemProps, String language)
-
-