public class CmsExtractionResult extends java.lang.Object implements I_CmsExtractionResult, java.io.Serializable
This data structure contains the extracted text as well as (optional) meta information extracted from the document.
ITEM_AUTHOR, ITEM_CATEGORY, ITEM_COMMENTS, ITEM_COMPANY, ITEM_CONTENT, ITEM_CREATOR, ITEM_KEYWORDS, ITEM_MANAGER, ITEM_PRODUCER, ITEM_RAW, ITEM_SUBJECT, ITEM_TITLE, ITEMS_TO_MERGE| Constructor and Description |
|---|
CmsExtractionResult(java.util.Locale defaultLocale,
java.util.Map<java.util.Locale,java.util.LinkedHashMap<java.lang.String,java.lang.String>> multilingualContentItems,
java.util.Map<java.lang.String,java.lang.String> fieldMappings)
Creates a new multilingual extraction result.
|
CmsExtractionResult(java.lang.String content)
Creates a new extraction result without meta information and without additional fields.
|
CmsExtractionResult(java.lang.String content,
java.util.LinkedHashMap<java.lang.String,java.lang.String> contentItems)
Creates a new unilingual extraction result.
|
CmsExtractionResult(java.lang.String content,
java.util.LinkedHashMap<java.lang.String,java.lang.String> contentItems,
java.util.Map<java.lang.String,java.lang.String> fieldMappings)
Creates a new unilingual extraction result.
|
| Modifier and Type | Method and Description |
|---|---|
static CmsExtractionResult |
fromBytes(byte[] bytes)
Creates an extraction result from a serialized byte array.
|
byte[] |
getBytes()
Returns this extraction result serialized as a byte array.
|
java.lang.String |
getContent()
Returns the extracted content of the best fitting locale combined as a String.
|
java.lang.String |
getContent(java.util.Locale locale)
Returns the extracted content for the given locale combined as a String.
|
java.util.LinkedHashMap<java.lang.String,java.lang.String> |
getContentItems()
Returns the extracted content for the best fitting locale as individual items.
|
java.util.LinkedHashMap<java.lang.String,java.lang.String> |
getContentItems(java.util.Locale locale)
Returns the extracted content for a given locale as individual items.
|
java.util.Locale |
getDefaultLocale()
Returns the best fitting locale for the content.
|
java.util.Map<java.lang.String,java.lang.String> |
getFieldMappings()
Returns a map from search fields to values that should be stored in that fields.
|
java.util.Collection<java.util.Locale> |
getLocales()
Returns the locales in which the content is available.
|
I_CmsExtractionResult |
merge(java.util.List<I_CmsExtractionResult> extractionResults)
Appends, for the locales of the current collection result, the content fields
from all provided extraction results to the current extraction result.
|
void |
release()
Releases the information stored in this extraction result, to free up the memory used.
|
public CmsExtractionResult(java.util.Locale defaultLocale, java.util.Map<java.util.Locale,java.util.LinkedHashMap<java.lang.String,java.lang.String>> multilingualContentItems, java.util.Map<java.lang.String,java.lang.String> fieldMappings)
defaultLocale - the default (best fitting) locale of the result.multilingualContentItems - the content items for the different localesfieldMappings - special mappings to search fields with values extracted from the contentpublic CmsExtractionResult(java.lang.String content)
content - the extracted contentpublic CmsExtractionResult(java.lang.String content, java.util.LinkedHashMap<java.lang.String,java.lang.String> contentItems)
content - the extracted contentcontentItems - the individual extracted content itemspublic CmsExtractionResult(java.lang.String content, java.util.LinkedHashMap<java.lang.String,java.lang.String> contentItems, java.util.Map<java.lang.String,java.lang.String> fieldMappings)
content - the extracted contentcontentItems - the individual extracted content itemsfieldMappings - extraction results that should directly be indexedpublic static final CmsExtractionResult fromBytes(byte[] bytes)
bytes - the serialized version of the extraction resultpublic byte[] getBytes()
I_CmsExtractionResultgetBytes in interface I_CmsExtractionResultI_CmsExtractionResult.getBytes()public java.lang.String getContent()
I_CmsExtractionResultgetContent in interface I_CmsExtractionResultI_CmsExtractionResult.getContent()public java.lang.String getContent(java.util.Locale locale)
I_CmsExtractionResultgetContent in interface I_CmsExtractionResultlocale - the locale of the extracted contentI_CmsExtractionResult.getContent(java.util.Locale)public java.util.LinkedHashMap<java.lang.String,java.lang.String> getContentItems()
I_CmsExtractionResultThe result Map contains all content items extracted by the extractor. The key is always a String, and contains the name of the item. The value is also a String and contains the extracted text.
The detailed form will depend on the resource type indexed:
xmlpage, the key will be the element name, and the value
will be the text of the element.
xmlcontent, the key will be the xpath of the XML node,
and the value will be the text of that XML node.
I_CmsExtractionResult.ITEM_CONTENT,
which will contain the value of the complete content.
getContentItems in interface I_CmsExtractionResultI_CmsExtractionResult.getContentItems()public java.util.LinkedHashMap<java.lang.String,java.lang.String> getContentItems(java.util.Locale locale)
I_CmsExtractionResultReturns the extracted content for a given locale as individual items.
getContentItems in interface I_CmsExtractionResultlocale - the locale of the extracted content itemsI_CmsExtractionResult.getContentItems(java.util.Locale)public java.util.Locale getDefaultLocale()
I_CmsExtractionResultgetDefaultLocale in interface I_CmsExtractionResultI_CmsExtractionResult.getDefaultLocale()public java.util.Map<java.lang.String,java.lang.String> getFieldMappings()
I_CmsExtractionResultgetFieldMappings in interface I_CmsExtractionResultI_CmsExtractionResult.getFieldMappings()public java.util.Collection<java.util.Locale> getLocales()
I_CmsExtractionResultgetLocales in interface I_CmsExtractionResultI_CmsExtractionResult.getLocales()public I_CmsExtractionResult merge(java.util.List<I_CmsExtractionResult> extractionResults)
I_CmsExtractionResultmerge in interface I_CmsExtractionResultextractionResults - the extraction results to mergeI_CmsExtractionResult.merge(java.util.List)public void release()
I_CmsExtractionResultrelease in interface I_CmsExtractionResultI_CmsExtractionResult.release()