Package org.opencms.search.fields
Interface I_CmsSearchFieldMapping
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
CmsGeoCoordinateFieldMapping,CmsMacroResolvingSearchFieldMapping,CmsMacroSearchFieldMapping,CmsSearchFieldMapping
Describes a mapping of a piece of content from an OpenCms VFS
resource to a field of a search index.
- Since:
- 8.5.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns the default value used for this field mapping in case no content is available.getParam()Returns the mapping parameter.getStringValue(CmsObject cms, CmsResource res, I_CmsExtractionResult extractionResult, List<CmsProperty> properties, List<CmsProperty> propertiesSearched) Returns the String value extracted form the provided data according to the rules of this mapping type.getType()Returns the mapping type.voidsetDefaultValue(String defaultValue) Sets the default value for this field mapping in case no content is available.default voidSets the locale, the mapping can examine when extracting the content.voidSets the mapping parameter.voidSets the mapping type as a String.voidSets the mapping type.
-
Method Details
-
getDefaultValue
Returns the default value used for this field mapping in case no content is available.- Returns:
- the default value used for this field mapping in case no content is available
-
getParam
Returns the mapping parameter.The parameter is used depending on the implementation of the rules of the selected
CmsSearchFieldMappingType.- Returns:
- the mapping parameter
-
getStringValue
String getStringValue(CmsObject cms, CmsResource res, I_CmsExtractionResult extractionResult, List<CmsProperty> properties, List<CmsProperty> propertiesSearched) Returns the String value extracted form the provided data according to the rules of this mapping type.- Parameters:
cms- the OpenCms context used for building the search indexres- the resource that is indexedextractionResult- the plain text extraction result from the resourceproperties- the list of all properties directly attached to the resource (not searched)propertiesSearched- the list of all searched properties of the resource- Returns:
- the String value extracted form the provided data according to the rules of this mapping type
-
getType
Returns the mapping type.- Returns:
- the mapping type
-
setDefaultValue
Sets the default value for this field mapping in case no content is available.- Parameters:
defaultValue- the default value to set
-
setLocale
Sets the locale, the mapping can examine when extracting the content. NOTE: This method is called byCmsDefaultXmlContentHandlerwhen dynamic search field mappings are created. Overwrite this default implementation if you need to map locale specific in your dynamic mapping.- Parameters:
locale- the locale of the index field that is filled by the mapping.
-
setParam
Sets the mapping parameter.The parameter is used depending on the implementation of the rules of the selected
CmsSearchFieldMappingType.- Parameters:
param- the parameter to set
-
setType
Sets the mapping type.- Parameters:
type- the type to set
-
setType
Sets the mapping type as a String.- Parameters:
type- the name of the type to set
-