org.opencms.search.solr
Class CmsSolrDocumentXmlContent

java.lang.Object
  extended by org.opencms.search.documents.A_CmsVfsDocument
      extended by org.opencms.search.documents.CmsDocumentXmlContent
          extended by org.opencms.search.solr.CmsSolrDocumentXmlContent
All Implemented Interfaces:
I_CmsDocumentFactory, I_CmsSearchExtractor
Direct Known Subclasses:
CmsSolrDocumentContainerPage

public class CmsSolrDocumentXmlContent
extends CmsDocumentXmlContent

Special document text extraction factory for Solr index.

Since:
8.5.0

Field Summary
static java.lang.String TYPE_XMLCONTENT_SOLR
          The solr document type name for xml-contents.
 
Fields inherited from class org.opencms.search.documents.A_CmsVfsDocument
m_name
 
Constructor Summary
CmsSolrDocumentXmlContent(java.lang.String name)
          Public constructor.
 
Method Summary
 I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, CmsSearchIndex index)
          Returns the raw text content of a given VFS resource of type CmsResourceTypeXmlContent.
 
Methods inherited from class org.opencms.search.documents.CmsDocumentXmlContent
createDocument, getDocumentKeys, isLocaleDependend, isUsingCache
 
Methods inherited from class org.opencms.search.documents.A_CmsVfsDocument
getCache, getDocumentKey, getName, logContentExtraction, readFile, setCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_XMLCONTENT_SOLR

public static final java.lang.String TYPE_XMLCONTENT_SOLR
The solr document type name for xml-contents.

See Also:
Constant Field Values
Constructor Detail

CmsSolrDocumentXmlContent

public CmsSolrDocumentXmlContent(java.lang.String name)
Public constructor.

Parameters:
name - the name for the document type
Method Detail

extractContent

public I_CmsExtractionResult extractContent(CmsObject cms,
                                            CmsResource resource,
                                            CmsSearchIndex index)
                                     throws CmsException
Description copied from class: CmsDocumentXmlContent
Returns the raw text content of a given VFS resource of type CmsResourceTypeXmlContent.

All XML nodes from the content for all locales will be stored separately in the item map which you can access using CmsExtractionResult.getContentItems(). The XML elements will be accessible using their xpath. The xpath will have the form like for example Text[1] or Nested[1]/Text[1].

Specified by:
extractContent in interface I_CmsSearchExtractor
Overrides:
extractContent in class CmsDocumentXmlContent
Parameters:
cms - the cms object
resource - the resource to extract the content from
index - the index to extract the content for
Returns:
the extracted content of the resource
Throws:
CmsException - if something goes wrong
See Also:
CmsDocumentXmlContent.extractContent(org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.CmsSearchIndex)