Package org.opencms.search.fields
Interface I_CmsSearchFieldConfiguration
-
- All Superinterfaces:
java.lang.Comparable<I_CmsSearchFieldConfiguration>
,java.io.Serializable
- All Known Implementing Classes:
A_CmsSearchFieldConfiguration
,CmsLuceneFieldConfiguration
,CmsSearchFieldConfiguration
,CmsSearchFieldConfigurationOldCategories
,CmsSolrFieldConfiguration
public interface I_CmsSearchFieldConfiguration extends java.lang.Comparable<I_CmsSearchFieldConfiguration>, java.io.Serializable
Interface for search field configurations used byI_CmsSearchIndex
and configured in the opencms-search.xml (seeCmsSearchConfiguration
).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addField(CmsSearchField field)
Adds a field to this search field configuration.void
addUninvertingMappings(java.util.Map<java.lang.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)
.I_CmsSearchDocument
createDocument(CmsObject cms, CmsResource resource, I_CmsSearchIndex index, I_CmsExtractionResult extractionResult)
Creates the document to index.java.lang.String
getDescription()
Returns the description of this field configuration.java.util.List<CmsSearchField>
getFields()
Returns the configuredCmsSearchField
instance with the given name.java.lang.String
getName()
Returns the name of this field configuration.void
init()
Initializes this field configuration.void
setDescription(java.lang.String description)
Sets the description of this field configuration.void
setName(java.lang.String name)
Sets the name of this field configuration.
-
-
-
Method Detail
-
addField
void addField(CmsSearchField field)
Adds a field to this search field configuration.- Parameters:
field
- the field to add
-
addUninvertingMappings
void addUninvertingMappings(java.util.Map<java.lang.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
java.lang.String getDescription()
Returns the description of this field configuration.- Returns:
- the description of this field configuration
-
getFields
java.util.List<CmsSearchField> getFields()
Returns the configuredCmsSearchField
instance with the given name.- Returns:
- the configured
CmsSearchField
instance with the given name
-
getName
java.lang.String getName()
Returns the name of this field configuration.- Returns:
- the name of this field configuration
-
init
void init()
Initializes this field configuration.
-
setDescription
void setDescription(java.lang.String description)
Sets the description of this field configuration.- Parameters:
description
- the description to set
-
setName
void setName(java.lang.String name)
Sets the name of this field configuration.- Parameters:
name
- the name to set
-
-