Class SolrContentIndexer
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.cms.content.indexing.solr.SolrContentIndexer
-
- All Implemented Interfaces:
SolrFieldNames
,LogEnabled
,Component
,Serviceable
public class SolrContentIndexer extends AbstractLogEnabled implements Component, Serviceable, SolrFieldNames
Component forContent
indexing into a Solr server.
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentHelper
_contentHelper
The content helperprotected ContentVisibleAttachmentIndexerExtensionPoint
_contentVisibleAttachmentIndexerEP
The extension point for ContentVisibleAttachmentIndexersprotected ContentTypeExtensionPoint
_cTypeEP
The content type extension pointprotected ContentTypesHelper
_cTypesHelper
The content type helperprotected LanguagesManager
_languagesManager
The manager for languagesprotected ServiceManager
_manager
Avalon service managerprotected OutgoingReferencesExtractor
_outgoingReferencesExtractor
The outgoing references extractorprotected AmetysObjectResolver
_resolver
The Ametys objet resolverprotected SolrResourceIndexer
_resourceIndexer
The resource indexerprotected SystemPropertyExtensionPoint
_systemPropEP
The system property extension point.protected Tika
_tika
The Tika instanceprotected UserHelper
_userHelper
The users managerstatic String
ROLE
The component role.-
Fields inherited from interface org.ametys.cms.content.indexing.solr.SolrFieldNames
ACL_INIT_VALUE_ALLOWED_GROUPS, ACL_INIT_VALUE_ALLOWED_USERS, ACL_INIT_VALUE_ANONYMOUS, ACL_INIT_VALUE_ANYCONNECTED, ACL_INIT_VALUE_DENIED_GROUPS, ACL_INIT_VALUE_DENIED_USERS, ALL_CONTENT_TYPES, ALL_MIXIN_TYPES, ALL_TAGS, ATTACHMENT_CONTENT_ID, CONTENT_COMMENTS, CONTENT_COMMENTS_NONVALIDATED, CONTENT_COMMENTS_VALIDATED, CONTENT_CREATOR, CONTENT_LANGUAGE, CONTENT_LANGUAGES, CONTENT_LAST_CONTRIBUTOR, CONTENT_NAME, CONTENT_OUTGOING_REFEERENCES_RESOURCE_IDS, CONTENT_TITLES, CONTENT_TYPE_RESOURCE, CONTENT_TYPES, CONTENT_VISIBLE_ATTACHMENT_RESOURCE_IDS, CREATION_DATE, DATE_FOR_SORTING, DATES_FACET, DC_CONTRIBUTOR, DC_COVERAGE, DC_CREATOR, DC_DATE, DC_DESCRIPTION, DC_FORMAT, DC_IDENTIFIER, DC_LANGUAGE, DC_PUBLISHER, DC_RELATION, DC_RIGHTS, DC_SOURCE, DC_SUBJECT, DC_TITLE, DC_TYPE, DOCUMENT_TYPE, EXCERPT, FILENAME, FIRST_VALIDATION, FULL_EXACT_WS, FULL_GENERAL, FULL_PREFIX, FULL_STEMMED_PREFIX, ID, IS_AMETYS_OBJECT, LAST_MAJOR_VALIDATION, LAST_MODIFIED, LAST_VALIDATION, LENGTH, MIME_TYPES, MIXIN_TYPES, PATH, PSEUDO_CONTENT_TYPE_VALUE_RESOURCE, PSEUDO_CONTENT_TYPES, REPEATER_ENTRY_POSITION, RESOURCE_ANCESTOR_AND_SELF_IDS, RESOURCE_ANCESTOR_IDS, RESOURCE_CREATOR, RESOURCE_DATE, RESOURCE_LAST_MODIFIED, RESOURCE_MIME_TYPE_GROUP, RESOURCE_ROOT_ID, SIMPLE_CONTENT_PARENTS, SUB_CONTENT, TAGS, TITLE, TITLE_SORT, TYPE_CONTENT, TYPE_CONTENT_ATTACHMENT_RESOURCE, TYPE_CONTENT_ATTRIBUTE_RESOURCE, TYPE_REPEATER, TYPE_RESOURCE, TYPE_WF_ENTRY, TYPE_WF_STEP, WORKFLOW_CURRENT_STEPS, WORKFLOW_CURRENT_STEPS_DV, WORKFLOW_ENTRY_STATE, WORKFLOW_HISTORY_STEPS, WORKFLOW_HISTORY_STEPS_DV, WORKFLOW_NAME, WORKFLOW_REF, WORKFLOW_REF_DV, WORKFLOW_STEP, WORKFLOW_STEP_ACTIONID, WORKFLOW_STEP_CALLER, WORKFLOW_STEP_DUEDATE, WORKFLOW_STEP_FINISHDATE, WORKFLOW_STEP_ID, WORKFLOW_STEP_OWNER, WORKFLOW_STEP_STARTDATE, WORKFLOW_STEP_STATUS
-
-
Constructor Summary
Constructors Constructor Description SolrContentIndexer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
_richTextToString(InputStream is)
Gets a XML as a string and extract the text onlyprotected void
findAndIndexMetadata(Content content, String[] pathSegments, CompositeMetadata metadata, MetadataDefinition definition, IndexingField field, String fieldName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Find the metadata to index from its pathprotected void
findAndIndexMetadataField(Content content, String[] pathSegments, CompositeMetadata metadata, MetadataDefinition definition, IndexingField field, String fieldName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Find and index a metadata.protected void
findAndIndexOverridingField(Content content, IndexingModel indexingModel, CustomMetadataIndexingField field, String fieldName, MetadataDefinition definition, String[] pathSegments, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Find and index a property represented by an overriding field.protected void
indexAllContentTypes(String cTypeId, org.apache.solr.common.SolrInputDocument document, String fieldName)
Index the content type and all its supertypes in the given document (recursively).void
indexBinaryMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'binary' metadatavoid
indexBooleanMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'boolean' metadatavoid
indexBooleanValues(Boolean[] values, org.apache.solr.common.SolrInputDocument document, String fieldName)
Index 'boolean' valuesvoid
indexCompositeMetadata(Content content, CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, MetadataDefinition definition, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Index a composite metadata, i.e.void
indexContent(Content content, org.apache.solr.common.SolrInputDocument document, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Populate a solr input document by adding fields to index into it.void
indexContentMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'content' metadataprotected void
indexContentTitle(Content content, org.apache.solr.common.SolrInputDocument document)
Index the content titlevoid
indexContentValues(String[] contentIds, org.apache.solr.common.SolrInputDocument document, String fieldName)
Index content values.void
indexDateMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'date' metadatavoid
indexDateTimeMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'datetime' metadatavoid
indexDateTimeValues(Date[] values, org.apache.solr.common.SolrInputDocument document, String fieldName)
Index 'datetime' valuesvoid
indexDateValues(Date[] values, org.apache.solr.common.SolrInputDocument document, String fieldName)
Index 'date' valuesvoid
indexDoubleMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'double' metadatavoid
indexDoubleValues(Double[] values, org.apache.solr.common.SolrInputDocument document, String fieldName, boolean isFacetable)
Index 'double' valuesvoid
indexFileMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'file' metadatavoid
indexFileValue(Object[] values, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)
Index a 'file' metadataprotected void
indexFullTextBinary(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'binary' metadataprotected void
indexFullTextBinaryValue(InputStream is, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)
Index a 'binary' valuestatic void
indexFulltextValue(org.apache.solr.common.SolrInputDocument document, String text, String language)
Index a full-text value.static void
indexFulltextValue(org.apache.solr.common.SolrInputDocument document, String text, Collection<String> languages)
Index a full-text value.protected void
indexFulltextValue(org.apache.solr.common.SolrInputDocument mainDocument, org.apache.solr.common.SolrInputDocument contentDoc, String text, String language)
Index a full-text value.void
indexGeoCodeMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'geocode' metadatavoid
indexGeocodeValue(double latitude, double longitude, org.apache.solr.common.SolrInputDocument document, String fieldName)
Index a 'geocode' metadataprotected static void
indexLanguageFulltextValue(org.apache.solr.common.SolrInputDocument document, String text, String language)
Index a full-text value in the language-specific fields.void
indexLongMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'long' metadatavoid
indexLongValues(Long[] values, org.apache.solr.common.SolrInputDocument document, String fieldName, boolean isFacetable)
Index 'long' valuesvoid
indexMetadata(Content content, String metadataName, CompositeMetadata metadata, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, List<org.apache.solr.common.SolrInputDocument> additionalDocuments, String fieldName, MetadataDefinition definition)
Index a content metadata.protected void
indexModelFields(Content content, org.apache.solr.common.SolrInputDocument document, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Index the fields specified in the indexation model.void
indexMultilingualStringMetadata(CompositeMetadata metadata, String metadataName, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, MetadataDefinition definition)
Index a multilingual string metadatavoid
indexMultilingualStringValues(String[] values, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)
Index multilingual 'string' valuesvoid
indexMultilingualStringValues(MultilingualString value, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName)
Index a multilingual string valuesvoid
indexMultilingualStringValuesForSorting(String value, org.apache.solr.common.SolrInputDocument document, String fieldName, String language)
Index multilingual 'string' value in sort fieldvoid
indexOverridingField(CustomMetadataIndexingField field, Content content, String fieldName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Index a property represented by an overriding field.boolean
indexPartialSystemProperty(Content content, String propertyId, org.apache.solr.common.SolrInputDocument document)
Populate a Solr input document by adding fields for a single system property.void
indexReferenceMetadata(CompositeMetadata metadata, String metadataName, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'reference' metadatavoid
indexRepeaterMetadata(Content content, CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, MetadataDefinition definition, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Index a repeater metadata, i.e.protected void
indexResourceContent(Resource resource, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String language)
Index the content of a resource.protected void
indexResourceContentValue(InputStream is, String[] keywords, String description, String language, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc)
Index the content of a resource.void
indexRichtextMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'richtext' metadatavoid
indexRichtextValue(RichText richText, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)
Index 'richtext' valuesvoid
indexStringMetadata(CompositeMetadata metadata, String metadataName, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'string' metadatavoid
indexStringValues(String[] values, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, boolean isFacetable)
Index 'string' valuesvoid
indexSubContentMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'sub_content' metadataprotected void
indexSystemProperties(Content content, org.apache.solr.common.SolrInputDocument document)
Index the system properties of a content.void
indexUserMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'user' metadatavoid
indexUserValues(UserIdentity[] users, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)
Index 'user' valuesvoid
indexValues(Content content, String fieldName, MetadataType type, Object[] values, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc)
Index valuesvoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys objet resolver
-
_cTypeEP
protected ContentTypeExtensionPoint _cTypeEP
The content type extension point
-
_cTypesHelper
protected ContentTypesHelper _cTypesHelper
The content type helper
-
_userHelper
protected UserHelper _userHelper
The users manager
-
_resourceIndexer
protected SolrResourceIndexer _resourceIndexer
The resource indexer
-
_systemPropEP
protected SystemPropertyExtensionPoint _systemPropEP
The system property extension point.
-
_contentHelper
protected ContentHelper _contentHelper
The content helper
-
_outgoingReferencesExtractor
protected OutgoingReferencesExtractor _outgoingReferencesExtractor
The outgoing references extractor
-
_contentVisibleAttachmentIndexerEP
protected ContentVisibleAttachmentIndexerExtensionPoint _contentVisibleAttachmentIndexerEP
The extension point for ContentVisibleAttachmentIndexers
-
_languagesManager
protected LanguagesManager _languagesManager
The manager for languages
-
_manager
protected ServiceManager _manager
Avalon service manager
-
-
Constructor Detail
-
SolrContentIndexer
public SolrContentIndexer()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
indexContent
public void indexContent(Content content, org.apache.solr.common.SolrInputDocument document, List<org.apache.solr.common.SolrInputDocument> additionalDocuments) throws Exception
Populate a solr input document by adding fields to index into it.- Parameters:
content
- The content to indexdocument
- The main solr document to index intoadditionalDocuments
- The additional documents for repeater instances- Throws:
Exception
- if an error occurred while indexing
-
indexContentTitle
protected void indexContentTitle(Content content, org.apache.solr.common.SolrInputDocument document)
Index the content title- Parameters:
content
- The titledocument
- The main solr document to index into
-
indexSystemProperties
protected void indexSystemProperties(Content content, org.apache.solr.common.SolrInputDocument document)
Index the system properties of a content.- Parameters:
content
- The content to index.document
- The solr document to index into.
-
indexAllContentTypes
protected void indexAllContentTypes(String cTypeId, org.apache.solr.common.SolrInputDocument document, String fieldName)
Index the content type and all its supertypes in the given document (recursively).- Parameters:
cTypeId
- The ID of the content type to index.document
- The solr document to index into.fieldName
- The field name.
-
indexModelFields
protected void indexModelFields(Content content, org.apache.solr.common.SolrInputDocument document, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Index the fields specified in the indexation model.- Parameters:
content
- The content to index.document
- The main content solr document.additionalDocuments
- The additional documents for repeater instances.
-
indexPartialSystemProperty
public boolean indexPartialSystemProperty(Content content, String propertyId, org.apache.solr.common.SolrInputDocument document) throws Exception
Populate a Solr input document by adding fields for a single system property.- Parameters:
content
- The content to indexpropertyId
- The system property ID.document
- The solr document- Returns:
- true if there are partial update to apply
- Throws:
Exception
- if an error occurred
-
findAndIndexMetadata
protected void findAndIndexMetadata(Content content, String[] pathSegments, CompositeMetadata metadata, MetadataDefinition definition, IndexingField field, String fieldName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Find the metadata to index from its path- Parameters:
content
- the content currently being traversed.pathSegments
- The segments of path of metadata to indexmetadata
- The parent composite metadatadefinition
- The metadata definitionfield
- the current indexing field.fieldName
- the name of the field to index.document
- The main solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).additionalDocuments
- The additional documents
-
findAndIndexMetadataField
protected void findAndIndexMetadataField(Content content, String[] pathSegments, CompositeMetadata metadata, MetadataDefinition definition, IndexingField field, String fieldName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Find and index a metadata.- Parameters:
content
- the current content being traversed.pathSegments
- the full metadata path segments.metadata
- the current metadata holder.definition
- the current metadata definition.field
- the current indexing field.fieldName
- the name of the field to index.document
- the solr main document.contentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).additionalDocuments
- the solr additional documents.
-
findAndIndexOverridingField
protected void findAndIndexOverridingField(Content content, IndexingModel indexingModel, CustomMetadataIndexingField field, String fieldName, MetadataDefinition definition, String[] pathSegments, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Find and index a property represented by an overriding field.- Parameters:
content
- the current content being traversed.indexingModel
- the current indexing model.pathSegments
- the full metadata path segments.definition
- the current metadata definition.field
- the current indexing field.fieldName
- the name of the field to index.document
- the solr main document.contentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).additionalDocuments
- the solr additional documents.
-
indexMetadata
public void indexMetadata(Content content, String metadataName, CompositeMetadata metadata, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, List<org.apache.solr.common.SolrInputDocument> additionalDocuments, String fieldName, MetadataDefinition definition)
Index a content metadata.- Parameters:
content
- the current content being traversed.metadataName
- The name of metadata to indexmetadata
- The parent composite metadatadocument
- the solr document to index into.contentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).additionalDocuments
- The solr additional documents used for repeater instancefieldName
- the name of the indexed field.definition
- the metadata definition.
-
indexOverridingField
public void indexOverridingField(CustomMetadataIndexingField field, Content content, String fieldName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Index a property represented by an overriding field.- Parameters:
field
- The overriding field.content
- The content of which to get the property.fieldName
- The name of the field to index.document
- the solr document to index into.contentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).additionalDocuments
- The solr additional documents used for repeater instance
-
indexValues
public void indexValues(Content content, String fieldName, MetadataType type, Object[] values, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc)
Index values- Parameters:
content
- The content being indexed.fieldName
- The Solr field's nametype
- the type of values to indexvalues
- the valuesdocument
- the Solr documentcontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).
-
indexReferenceMetadata
public void indexReferenceMetadata(CompositeMetadata metadata, String metadataName, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'reference' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexcontentId
- The content id. For logging purposesdocument
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field namelanguage
- The content language.definition
- The metadata definition
-
indexStringMetadata
public void indexStringMetadata(CompositeMetadata metadata, String metadataName, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'string' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexcontentId
- The content id. For logging purposesdocument
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field namelanguage
- The content language.definition
- The metadata definition
-
indexMultilingualStringMetadata
public void indexMultilingualStringMetadata(CompositeMetadata metadata, String metadataName, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, MetadataDefinition definition)
Index a multilingual string metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexcontentId
- The content id. For logging purposesdocument
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field namedefinition
- The metadata definition
-
indexMultilingualStringValues
public void indexMultilingualStringValues(MultilingualString value, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName)
Index a multilingual string values- Parameters:
value
- The multilingual stringcontentId
- The content id. For logging purposesdocument
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field name
-
indexMultilingualStringValues
public void indexMultilingualStringValues(String[] values, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)
Index multilingual 'string' values- Parameters:
values
- The valuescontentId
- The content id. For logging purposesdocument
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field namelanguage
- The language for values.
-
indexMultilingualStringValuesForSorting
public void indexMultilingualStringValuesForSorting(String value, org.apache.solr.common.SolrInputDocument document, String fieldName, String language)
Index multilingual 'string' value in sort field- Parameters:
value
- The valuedocument
- The solr document to index intofieldName
- The index field namelanguage
- The language
-
indexStringValues
public void indexStringValues(String[] values, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, boolean isFacetable)
Index 'string' values- Parameters:
values
- The valuescontentId
- The content id. For logging purposesdocument
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field namelanguage
- The content language.isFacetable
- true if the field can be used as a facet.
-
indexDateMetadata
public void indexDateMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'date' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intofieldName
- The index field namedefinition
- The metadata definition
-
indexDateValues
public void indexDateValues(Date[] values, org.apache.solr.common.SolrInputDocument document, String fieldName)
Index 'date' values- Parameters:
values
- The valuesdocument
- The solr document to index intofieldName
- The index field name
-
indexDateTimeMetadata
public void indexDateTimeMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'datetime' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intofieldName
- The index field namedefinition
- The metadata definition
-
indexDateTimeValues
public void indexDateTimeValues(Date[] values, org.apache.solr.common.SolrInputDocument document, String fieldName)
Index 'datetime' values- Parameters:
values
- The valuesdocument
- The solr document to index intofieldName
- The index field name
-
indexDoubleMetadata
public void indexDoubleMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'double' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intofieldName
- The index field namedefinition
- The metadata definition
-
indexDoubleValues
public void indexDoubleValues(Double[] values, org.apache.solr.common.SolrInputDocument document, String fieldName, boolean isFacetable)
Index 'double' values- Parameters:
values
- The valuesdocument
- The solr document to index intofieldName
- The index field nameisFacetable
- true if the field can be used as a facet.
-
indexLongMetadata
public void indexLongMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'long' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intofieldName
- The index field namedefinition
- The metadata definition
-
indexLongValues
public void indexLongValues(Long[] values, org.apache.solr.common.SolrInputDocument document, String fieldName, boolean isFacetable)
Index 'long' values- Parameters:
values
- The valuesdocument
- The solr document to index intofieldName
- The index field nameisFacetable
- true if the field can be used as a facet.
-
indexUserMetadata
public void indexUserMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'user' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field namelanguage
- The content language.definition
- The metadata definition
-
indexUserValues
public void indexUserValues(UserIdentity[] users, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)
Index 'user' values- Parameters:
users
- The usersdocument
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field namelanguage
- The content language.
-
indexBooleanMetadata
public void indexBooleanMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'boolean' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intofieldName
- The index field namedefinition
- The metadata definition
-
indexBooleanValues
public void indexBooleanValues(Boolean[] values, org.apache.solr.common.SolrInputDocument document, String fieldName)
Index 'boolean' values- Parameters:
values
- The valuesdocument
- The solr document to index intofieldName
- The index field name
-
indexRichtextMetadata
public void indexRichtextMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'richtext' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field namelanguage
- The content language.definition
- The metadata definition
-
indexRichtextValue
public void indexRichtextValue(RichText richText, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)
Index 'richtext' values- Parameters:
richText
- The rich text to index.document
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field name.language
- The content language.
-
_richTextToString
protected String _richTextToString(InputStream is)
Gets a XML as a string and extract the text only- Parameters:
is
- The inputstream of XML- Returns:
- The text or null if the XML is not well formed
-
indexBinaryMetadata
public void indexBinaryMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'binary' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field namelanguage
- The content language.definition
- The metadata definition
-
indexFileMetadata
public void indexFileMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'file' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field namelanguage
- The content language.definition
- The metadata definition
-
indexFileValue
public void indexFileValue(Object[] values, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)
Index a 'file' metadata- Parameters:
values
- The values.document
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field namelanguage
- The content language.
-
indexFullTextBinary
protected void indexFullTextBinary(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, MetadataDefinition definition)
Index a 'binary' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intocontentDoc
- The content document.fieldName
- The index field namelanguage
- The content language.definition
- The metadata definition
-
indexFullTextBinaryValue
protected void indexFullTextBinaryValue(InputStream is, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)
Index a 'binary' value- Parameters:
is
- An InputStream on the binary data.document
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The index field namelanguage
- The content language.
-
indexContentMetadata
public void indexContentMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'content' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intofieldName
- The index field namedefinition
- The metadata definition
-
indexContentValues
public void indexContentValues(String[] contentIds, org.apache.solr.common.SolrInputDocument document, String fieldName)
Index content values.- Parameters:
contentIds
- The ID of the contents to index.document
- The solr document to index into.fieldName
- the field name.
-
indexSubContentMetadata
public void indexSubContentMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'sub_content' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intofieldName
- The index field namedefinition
- The metadata definition
-
indexGeoCodeMetadata
public void indexGeoCodeMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)
Index a 'geocode' metadata- Parameters:
metadata
- The parent composite metadatametadataName
- The name of metadata to indexdocument
- The solr document to index intofieldName
- The index field namedefinition
- The metadata definition
-
indexGeocodeValue
public void indexGeocodeValue(double latitude, double longitude, org.apache.solr.common.SolrInputDocument document, String fieldName)
Index a 'geocode' metadata- Parameters:
latitude
- the coord latitude.longitude
- the coord longitude.document
- The solr document to index intofieldName
- The index field name
-
indexCompositeMetadata
public void indexCompositeMetadata(Content content, CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, MetadataDefinition definition, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Index a composite metadata, i.e. browse and index the sub-metadatas.- Parameters:
content
- The content being indexed.metadata
- The parent metadata.metadataName
- The composite metadata name.document
- The solr document to index into.contentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The field name.definition
- The composite metadata definition.additionalDocuments
- The solr additional documents used for repeater instance
-
indexRepeaterMetadata
public void indexRepeaterMetadata(Content content, CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, MetadataDefinition definition, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)
Index a repeater metadata, i.e. browse and index the entries.- Parameters:
content
- The content being indexed.metadata
- The parent metadata.metadataName
- The repeater metadata name.document
- The solr document to index into.contentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).fieldName
- The field name.definition
- The repeater metadata definition.additionalDocuments
- The solr additional documents used for repeater instance
-
indexResourceContent
protected void indexResourceContent(Resource resource, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String language)
Index the content of a resource.- Parameters:
resource
- The resourcedocument
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).language
- The content language.
-
indexResourceContentValue
protected void indexResourceContentValue(InputStream is, String[] keywords, String description, String language, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc) throws IOException, TikaException
Index the content of a resource.- Parameters:
is
- An input stream on the resource content.keywords
- The resource keywords.description
- The resource description.language
- The content language.document
- The solr document to index intocontentDoc
- The parent content document to index into (can be null if the main document is the content doc itself).- Throws:
TikaException
- If an error occurs extracting the document's text content.IOException
- If an error occurs reading the document's text content.
-
indexFulltextValue
protected void indexFulltextValue(org.apache.solr.common.SolrInputDocument mainDocument, org.apache.solr.common.SolrInputDocument contentDoc, String text, String language)
Index a full-text value.- Parameters:
mainDocument
- The document being used, can be either the content document itself or a repeater document.contentDoc
- The parent content document. If the mainDocument is the content document, this will be null.text
- The text to index.language
- The content language.
-
indexFulltextValue
public static void indexFulltextValue(org.apache.solr.common.SolrInputDocument document, String text, String language)
Index a full-text value.- Parameters:
document
- The document to index into.text
- The text to index.language
- The content language.
-
indexFulltextValue
public static void indexFulltextValue(org.apache.solr.common.SolrInputDocument document, String text, Collection<String> languages)
Index a full-text value.- Parameters:
document
- The document to index into.text
- The text to index.languages
- The languages.
-
indexLanguageFulltextValue
protected static void indexLanguageFulltextValue(org.apache.solr.common.SolrInputDocument document, String text, String language)
Index a full-text value in the language-specific fields.- Parameters:
document
- The document to index into.text
- The text to index.language
- The content language.
-
-