Package org.opencms.search.fields
Interface I_CmsSearchFieldConfiguration
- All Superinterfaces:
Comparable<I_CmsSearchFieldConfiguration>
,Serializable
- All Known Implementing Classes:
A_CmsSearchFieldConfiguration
,CmsLuceneFieldConfiguration
,CmsSearchFieldConfiguration
,CmsSearchFieldConfigurationOldCategories
,CmsSolrFieldConfiguration
public interface I_CmsSearchFieldConfiguration
extends Comparable<I_CmsSearchFieldConfiguration>, Serializable
Interface for search field configurations used by
I_CmsSearchIndex
and configured in the
opencms-search.xml (see CmsSearchConfiguration
).-
Method Summary
Modifier and TypeMethodDescriptionvoid
addField
(CmsSearchField field) Adds a field to this search field configuration.void
addUninvertingMappings
(Map<String, org.apache.solr.uninverting.UninvertingReader.Type> uninvertingMap) To allow sorting on a field (without docvalues) the field must be added to the map given toUninvertingReader.wrap(org.apache.lucene.index.DirectoryReader, Map)
.createDocument
(CmsObject cms, CmsResource resource, I_CmsSearchIndex index, I_CmsExtractionResult extractionResult) Creates the document to index.Returns the description of this field configuration.Returns the configuredCmsSearchField
instance with the given name.getName()
Returns the name of this field configuration.void
init()
Initializes this field configuration.void
setDescription
(String description) Sets the description of this field configuration.void
Sets the name of this field configuration.Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
addField
Adds a field to this search field configuration.- Parameters:
field
- the field to add
-
addUninvertingMappings
void addUninvertingMappings(Map<String, org.apache.solr.uninverting.UninvertingReader.Type> uninvertingMap) To allow sorting on a field (without docvalues) the field must be added to the map given toUninvertingReader.wrap(org.apache.lucene.index.DirectoryReader, Map)
. The method adds the configured fields.- Parameters:
uninvertingMap
- the map to which the fields are added.
-
createDocument
I_CmsSearchDocument createDocument(CmsObject cms, CmsResource resource, I_CmsSearchIndex index, I_CmsExtractionResult extractionResult) throws CmsException Creates the document to index. The structure of the document depends on the concrete field configuration, the provided VFS resource, search index and extracted content.The method is typically triggered by
I_CmsDocumentFactory.createDocument(CmsObject, CmsResource, I_CmsSearchIndex)
to create the document.- Parameters:
cms
- the OpenCms user context used to access the OpenCms VFSresource
- the resource to create the document fromindex
- the search index to create the document forextractionResult
- the plain text content and additional information extracted from the document- Returns:
- the document to index for the given VFS resource and the given search index
- Throws:
CmsException
- if something goes wrong
-
getDescription
Returns the description of this field configuration.- Returns:
- the description of this field configuration
-
getFields
Returns the configuredCmsSearchField
instance with the given name.- Returns:
- the configured
CmsSearchField
instance with the given name
-
getName
Returns the name of this field configuration.- Returns:
- the name of this field configuration
-
init
void init()Initializes this field configuration. -
setDescription
Sets the description of this field configuration.- Parameters:
description
- the description to set
-
setName
Sets the name of this field configuration.- Parameters:
name
- the name to set
-