public class SolrResourceIndexer extends AbstractLogEnabled implements Component, Serviceable, SolrFieldNames
Populate a Solr input document with the following fields:
"document"
value
Modifier and Type | Field and Description |
---|---|
protected LanguagesManager |
_langManager
The language manager.
|
protected Tika |
_tika
The Tika instance.
|
static String |
ROLE
The avalon role.
|
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, 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, 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, REPEATER_ENTRY_POSITION, RESOURCE_ANCESTOR_IDS, RESOURCE_CREATOR, RESOURCE_DATE, RESOURCE_LAST_MODIFIED, RESOURCE_ROOT_ID, SIMPLE_CONTENT_PARENTS, SUB_CONTENT, TAGS, TITLE, TITLE_SORT, TYPE_CONTENT, TYPE_CONTENT_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 and Description |
---|
SolrResourceIndexer() |
Modifier and Type | Method and Description |
---|---|
private void |
_indexAncestorIds(Resource resource,
SolrInputDocument document) |
private static void |
_indexNonNullValue(SolrInputDocument document,
String fieldName,
String value) |
private static void |
_indexNonNullValue(SolrInputDocument document,
String fieldName,
String[] values) |
void |
indexDublinCoreMetadata(DublinCoreAwareAmetysObject object,
SolrInputDocument document)
Index Dublin core metadata.
|
protected void |
indexFulltextValue(SolrInputDocument document,
String text,
String language)
Index a full-text value.
|
void |
indexResource(Resource resource,
SolrInputDocument document,
String documentType)
Index a resource.
|
void |
indexResource(Resource resource,
SolrInputDocument document,
String documentType,
String language)
Index a resource.
|
void |
indexResource(Resource resource,
SolrInputDocument document,
String documentType,
String language,
TraversableAmetysObject resourceRoot)
Index a resource.
|
void |
indexResource(Resource resource,
SolrInputDocument document,
String documentType,
TraversableAmetysObject resourceRoot)
Index a resource.
|
void |
indexResourceCollection(ResourceCollection resourceCollection,
SolrInputDocument document,
String language)
Index a collection of resources.
|
void |
indexResourceContent(Resource resource,
SolrInputDocument document,
String language)
Index a resource content (text in case of a document, and Dublin Core metadata).
|
void |
service(ServiceManager manager) |
getLogger, setLogger
protected LanguagesManager _langManager
public SolrResourceIndexer()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void indexResource(Resource resource, SolrInputDocument document, String documentType) throws Exception
resource
- The resource to index.document
- The Solr document to index into.documentType
- The document type of the resourceException
- if an error occurs.public void indexResource(Resource resource, SolrInputDocument document, String documentType, String language) throws Exception
resource
- The resource to index.document
- The Solr document to index into.documentType
- The document type of the resourcelanguage
- The query language.Exception
- if an error occurs.public void indexResource(Resource resource, SolrInputDocument document, String documentType, TraversableAmetysObject resourceRoot) throws Exception
resource
- The resource to index.document
- The Solr document to index into.documentType
- The document type of the resourceresourceRoot
- The resource root, can be null. When null, it will have to be computed.Exception
- if an error occurs.public void indexResource(Resource resource, SolrInputDocument document, String documentType, String language, TraversableAmetysObject resourceRoot) throws Exception
resource
- The resource to index.document
- The Solr document to index into.documentType
- The document type of the resourcelanguage
- The language, can be null.resourceRoot
- The resource root, can be null. When null, it will have to be computed.Exception
- if an error occurs.private void _indexAncestorIds(Resource resource, SolrInputDocument document)
public void indexResourceCollection(ResourceCollection resourceCollection, SolrInputDocument document, String language) throws Exception
resourceCollection
- the resource collection to index.document
- The document to index into.language
- The current language.Exception
- if an error occurs while indexing.public void indexResourceContent(Resource resource, SolrInputDocument document, String language)
resource
- The resource to index.document
- The document to index into.language
- The current language, can be null.protected void indexFulltextValue(SolrInputDocument document, String text, String language)
document
- The document to index into.text
- The text to index.language
- The content language, can be null.public void indexDublinCoreMetadata(DublinCoreAwareAmetysObject object, SolrInputDocument document)
object
- the DublinCoreAwareAmetysObject
holding Dublin Core metadata.document
- the solr input document to populate.private static void _indexNonNullValue(SolrInputDocument document, String fieldName, String value)
private static void _indexNonNullValue(SolrInputDocument document, String fieldName, String[] values)