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 forContentindexing into a Solr server.
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentHelper_contentHelperThe content helperprotected ContentVisibleAttachmentIndexerExtensionPoint_contentVisibleAttachmentIndexerEPThe extension point for ContentVisibleAttachmentIndexersprotected ContentTypeExtensionPoint_cTypeEPThe content type extension pointprotected ContentTypesHelper_cTypesHelperThe content type helperprotected LanguagesManager_languagesManagerThe manager for languagesprotected ServiceManager_managerAvalon service managerprotected OutgoingReferencesExtractor_outgoingReferencesExtractorThe outgoing references extractorprotected AmetysObjectResolver_resolverThe Ametys objet resolverprotected SolrResourceIndexer_resourceIndexerThe resource indexerprotected SystemPropertyExtensionPoint_systemPropEPThe system property extension point.protected Tika_tikaThe Tika instanceprotected UserHelper_userHelperThe users managerstatic StringROLEThe 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 voidfindAndIndexMetadata(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 voidfindAndIndexMetadataField(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 voidfindAndIndexOverridingField(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 voidindexAllContentTypes(String cTypeId, org.apache.solr.common.SolrInputDocument document, String fieldName)Index the content type and all its supertypes in the given document (recursively).voidindexBinaryMetadata(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' metadatavoidindexBooleanMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)Index a 'boolean' metadatavoidindexBooleanValues(Boolean[] values, org.apache.solr.common.SolrInputDocument document, String fieldName)Index 'boolean' valuesvoidindexCompositeMetadata(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.voidindexContent(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.voidindexContentMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)Index a 'content' metadataprotected voidindexContentTitle(Content content, org.apache.solr.common.SolrInputDocument document)Index the content titlevoidindexContentValues(String[] contentIds, org.apache.solr.common.SolrInputDocument document, String fieldName)Index content values.voidindexDateMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)Index a 'date' metadatavoidindexDateTimeMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)Index a 'datetime' metadatavoidindexDateTimeValues(Date[] values, org.apache.solr.common.SolrInputDocument document, String fieldName)Index 'datetime' valuesvoidindexDateValues(Date[] values, org.apache.solr.common.SolrInputDocument document, String fieldName)Index 'date' valuesvoidindexDoubleMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)Index a 'double' metadatavoidindexDoubleValues(Double[] values, org.apache.solr.common.SolrInputDocument document, String fieldName, boolean isFacetable)Index 'double' valuesvoidindexFileMetadata(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' metadatavoidindexFileValue(Object[] values, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)Index a 'file' metadataprotected voidindexFullTextBinary(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 voidindexFullTextBinaryValue(InputStream is, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)Index a 'binary' valuestatic voidindexFulltextValue(org.apache.solr.common.SolrInputDocument document, String text, String language)Index a full-text value.static voidindexFulltextValue(org.apache.solr.common.SolrInputDocument document, String text, Collection<String> languages)Index a full-text value.protected voidindexFulltextValue(org.apache.solr.common.SolrInputDocument mainDocument, org.apache.solr.common.SolrInputDocument contentDoc, String text, String language)Index a full-text value.voidindexGeoCodeMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)Index a 'geocode' metadatavoidindexGeocodeValue(double latitude, double longitude, org.apache.solr.common.SolrInputDocument document, String fieldName)Index a 'geocode' metadataprotected static voidindexLanguageFulltextValue(org.apache.solr.common.SolrInputDocument document, String text, String language)Index a full-text value in the language-specific fields.voidindexLongMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)Index a 'long' metadatavoidindexLongValues(Long[] values, org.apache.solr.common.SolrInputDocument document, String fieldName, boolean isFacetable)Index 'long' valuesvoidindexMetadata(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 voidindexModelFields(Content content, org.apache.solr.common.SolrInputDocument document, List<org.apache.solr.common.SolrInputDocument> additionalDocuments)Index the fields specified in the indexation model.voidindexMultilingualStringMetadata(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 metadatavoidindexMultilingualStringValues(String[] values, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)Index multilingual 'string' valuesvoidindexMultilingualStringValues(MultilingualString value, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName)Index a multilingual string valuesvoidindexMultilingualStringValuesForSorting(String value, org.apache.solr.common.SolrInputDocument document, String fieldName, String language)Index multilingual 'string' value in sort fieldvoidindexOverridingField(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.booleanindexPartialSystemProperty(Content content, String propertyId, org.apache.solr.common.SolrInputDocument document)Populate a Solr input document by adding fields for a single system property.voidindexReferenceMetadata(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' metadatavoidindexRepeaterMetadata(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 voidindexResourceContent(Resource resource, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String language)Index the content of a resource.protected voidindexResourceContentValue(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.voidindexRichtextMetadata(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' metadatavoidindexRichtextValue(RichText richText, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)Index 'richtext' valuesvoidindexStringMetadata(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' metadatavoidindexStringValues(String[] values, String contentId, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language, boolean isFacetable)Index 'string' valuesvoidindexSubContentMetadata(CompositeMetadata metadata, String metadataName, org.apache.solr.common.SolrInputDocument document, String fieldName, MetadataDefinition definition)Index a 'sub_content' metadataprotected voidindexSystemProperties(Content content, org.apache.solr.common.SolrInputDocument document)Index the system properties of a content.voidindexUserMetadata(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' metadatavoidindexUserValues(UserIdentity[] users, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc, String fieldName, String language)Index 'user' valuesvoidindexValues(Content content, String fieldName, MetadataType type, Object[] values, org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument contentDoc)Index valuesvoidservice(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:
servicein 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.
-
-