public class CmsSolrFieldConfiguration extends CmsSearchFieldConfiguration
LAZY_FIELDS, STR_STANDARD| Constructor and Description |
|---|
CmsSolrFieldConfiguration()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAdditionalFields(java.util.List<CmsSolrField> additionalFields)
Adds the additional fields to the configuration, if they are not null.
|
protected I_CmsSearchDocument |
appendAdditionalValuesToDcoument(I_CmsSearchDocument document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Overriding this method allows to append some 'extra' values/fields to a document
without overriding the
CmsSearchFieldConfiguration.createDocument(org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.I_CmsSearchIndex, org.opencms.search.extractors.I_CmsExtractionResult) method itself. |
protected I_CmsSearchDocument |
appendDates(I_CmsSearchDocument document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Extends the given document by fields for date of creation, content and last modification.
|
protected I_CmsSearchDocument |
appendFieldMapping(I_CmsSearchDocument document,
CmsSearchField sfield,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Extends the given document by the mappings for the given field.
|
protected I_CmsSearchDocument |
appendFieldMappings(I_CmsSearchDocument document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Extends the given document by the configured field mappings.
|
protected I_CmsSearchDocument |
appendFieldMappingsFromElementsOnThePage(I_CmsSearchDocument document,
CmsObject cms,
CmsResource resource,
java.util.List<java.lang.String> systemFields)
Adds search fields from elements on a container page to a container page's document.
|
protected I_CmsSearchDocument |
appendLocales(I_CmsSearchDocument document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extraction,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Extends the given document by the "res_locales" field.
|
protected I_CmsSearchDocument |
appendProperties(I_CmsSearchDocument document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extraction,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Appends all direct properties, that are not empty or white space only to the document.
|
protected java.util.List<java.util.Locale> |
getContentLocales(CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extraction)
Retrieves the locales for an content, that is whether an XML content nor an XML page.
|
java.util.Map<java.lang.String,CmsSolrField> |
getSolrFields()
Returns all configured Solr fields.
|
protected java.util.Set<CmsSearchField> |
getXSDMappings(CmsObject cms,
CmsResource resource)
Returns the search field mappings declared within the XSD.
|
protected java.util.Set<CmsSearchField> |
getXSDMappingsForPage(CmsObject cms,
CmsResource resource)
Returns the search field mappings declared within the XSD that should be applied to the container page.
|
void |
init()
Initializes this field configuration.
|
addUninvertingMappings, appendCategories, appendContentBlob, appendFileSize, appendPath, appendType, createDocument, getIndex, getLocaleExtendedName, getLocaleExtendedName, getParentFolderTokens, setIndexaddField, compareTo, equals, getDescription, getField, getFieldNames, getFields, getName, hashCode, setDescription, setNamepublic CmsSolrFieldConfiguration()
public void addAdditionalFields(java.util.List<CmsSolrField> additionalFields)
additionalFields - the additional fields to addpublic java.util.Map<java.lang.String,CmsSolrField> getSolrFields()
public void init()
I_CmsSearchFieldConfigurationinit in interface I_CmsSearchFieldConfigurationinit in class A_CmsSearchFieldConfigurationA_CmsSearchFieldConfiguration.init()protected I_CmsSearchDocument appendAdditionalValuesToDcoument(I_CmsSearchDocument document, CmsObject cms, CmsResource resource, I_CmsExtractionResult extractionResult, java.util.List<CmsProperty> properties, java.util.List<CmsProperty> propertiesSearched)
CmsSearchFieldConfigurationCmsSearchFieldConfiguration.createDocument(org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.I_CmsSearchIndex, org.opencms.search.extractors.I_CmsExtractionResult) method itself.
The method CmsSearchFieldConfiguration.createDocument(org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.I_CmsSearchIndex, org.opencms.search.extractors.I_CmsExtractionResult) reads all properties of the current resource which is
an expensive operation. In order to avoid reading those properties twice, this method has been introduced.
Compared with all the other appender methods the name of this method is generic.
In this default implementation the document is returned unchanged.
appendAdditionalValuesToDcoument in class CmsSearchFieldConfigurationdocument - the document to extendcms - the OpenCms context used for building the search indexresource - 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 resourceCmsSearchFieldConfiguration.appendAdditionalValuesToDcoument(org.opencms.search.I_CmsSearchDocument, org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.extractors.I_CmsExtractionResult, java.util.List, java.util.List)protected I_CmsSearchDocument appendDates(I_CmsSearchDocument document, CmsObject cms, CmsResource resource, I_CmsExtractionResult extractionResult, java.util.List<CmsProperty> properties, java.util.List<CmsProperty> propertiesSearched)
CmsSearchFieldConfigurationappendDates in class CmsSearchFieldConfigurationdocument - the document to extendcms - the OpenCms context used for building the search indexresource - 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 resourceCmsSearchFieldConfiguration.appendDates(org.opencms.search.I_CmsSearchDocument, org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.extractors.I_CmsExtractionResult, java.util.List, java.util.List)protected I_CmsSearchDocument appendFieldMapping(I_CmsSearchDocument document, CmsSearchField sfield, CmsObject cms, CmsResource resource, I_CmsExtractionResult extractionResult, java.util.List<CmsProperty> properties, java.util.List<CmsProperty> propertiesSearched)
CmsSearchFieldConfigurationappendFieldMapping in class CmsSearchFieldConfigurationdocument - the document to extendsfield - the field to create the mappings forcms - the OpenCms context used for building the search indexresource - 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 resourceCmsSearchFieldConfiguration.appendFieldMapping(org.opencms.search.I_CmsSearchDocument, org.opencms.search.fields.CmsSearchField, org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.extractors.I_CmsExtractionResult, java.util.List, java.util.List)protected I_CmsSearchDocument appendFieldMappings(I_CmsSearchDocument document, CmsObject cms, CmsResource resource, I_CmsExtractionResult extractionResult, java.util.List<CmsProperty> properties, java.util.List<CmsProperty> propertiesSearched)
CmsSearchFieldConfigurationappendFieldMappings in class CmsSearchFieldConfigurationdocument - the document to extendcms - the OpenCms context used for building the search indexresource - 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 resourceCmsSearchFieldConfiguration.appendFieldMappings(org.opencms.search.I_CmsSearchDocument, org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.extractors.I_CmsExtractionResult, java.util.List, java.util.List)protected I_CmsSearchDocument appendFieldMappingsFromElementsOnThePage(I_CmsSearchDocument document, CmsObject cms, CmsResource resource, java.util.List<java.lang.String> systemFields)
document - The document for the container pagecms - The current CmsObjectresource - The resource of the container pagesystemFields - The list of field names for fields where mappings to should be discarded, since these fields are used system internally.protected I_CmsSearchDocument appendLocales(I_CmsSearchDocument document, CmsObject cms, CmsResource resource, I_CmsExtractionResult extraction, java.util.List<CmsProperty> properties, java.util.List<CmsProperty> propertiesSearched)
CmsSearchFieldConfigurationappendLocales in class CmsSearchFieldConfigurationdocument - the document to extendcms - the OpenCms context used for building the search indexresource - the resource that is indexedextraction - 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 resourceCmsSearchFieldConfiguration.appendLocales(org.opencms.search.I_CmsSearchDocument, org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.extractors.I_CmsExtractionResult, java.util.List, java.util.List)protected I_CmsSearchDocument appendProperties(I_CmsSearchDocument document, CmsObject cms, CmsResource resource, I_CmsExtractionResult extraction, java.util.List<CmsProperty> properties, java.util.List<CmsProperty> propertiesSearched)
CmsSearchFieldConfigurationappendProperties in class CmsSearchFieldConfigurationdocument - the document to extendcms - the OpenCms context used for building the search indexresource - the resource that is indexedextraction - 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 resourceCmsSearchFieldConfiguration.appendProperties(org.opencms.search.I_CmsSearchDocument, org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.extractors.I_CmsExtractionResult, java.util.List, java.util.List)protected java.util.List<java.util.Locale> getContentLocales(CmsObject cms, CmsResource resource, I_CmsExtractionResult extraction)
Uses following strategy:
cms - the current CmsObjectresource - the resource to get the content locales forextraction - the extraction resultprotected java.util.Set<CmsSearchField> getXSDMappings(CmsObject cms, CmsResource resource)
cms - the CmsObjectresource - the resourceprotected java.util.Set<CmsSearchField> getXSDMappingsForPage(CmsObject cms, CmsResource resource)
cms - the CmsObjectresource - the resource