public class SubDocumentElementParser extends Object implements ElementParser
ElementParser implementation that parses elements that ara tagged with an attribute that indicates
that it's sub-elements should be treated as sub-documents or child documents.| Modifier and Type | Field and Description |
|---|---|
protected String |
containsSubDocumentsAttributeName |
protected String |
contentTypeFieldName |
static String |
DEFAULT_CONTAINS_SUB_DOCUMENTS_ATTRIBUTE_NAME |
static String |
DEFAULT_CONTENT_TYPE_FIELD_NAME |
static String |
DEFAULT_PARENT_ID_FIELD_NAME |
static String |
DEFAULT_SUB_DOCUMENT_ELEMENT_NAME |
protected String |
idFieldName |
protected String |
localIdFieldName |
protected String |
parentIdFieldName |
protected String |
publishingDateAltFieldName |
protected String |
publishingDateFieldName |
protected String |
rootIdFieldName |
protected String |
siteFieldName |
protected String |
subDocumentElementName |
| Constructor and Description |
|---|
SubDocumentElementParser() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
parse(org.dom4j.Element element,
String fieldName,
String parentFieldName,
org.apache.solr.common.SolrInputDocument solrDoc,
ElementParserService parserService)
Parses the given element, generating one or more Solr fields and adding them to the given document.
|
void |
setContainsSubDocumentsAttributeName(String containsSubDocumentsAttributeName) |
void |
setContentTypeFieldName(String contentTypeFieldName) |
void |
setIdFieldName(String idFieldName) |
void |
setLocalIdFieldName(String localIdFieldName) |
void |
setParentIdFieldName(String parentIdFieldName) |
void |
setPublishingDateAltFieldName(String publishingDateAltFieldName) |
void |
setPublishingDateFieldName(String publishingDateFieldName) |
void |
setRootIdFieldName(String rootIdFieldName) |
void |
setSiteFieldName(String siteFieldName) |
void |
setSubDocumentElementName(String subDocumentElementName) |
public static final String DEFAULT_CONTENT_TYPE_FIELD_NAME
public static final String DEFAULT_PARENT_ID_FIELD_NAME
public static final String DEFAULT_CONTAINS_SUB_DOCUMENTS_ATTRIBUTE_NAME
public static final String DEFAULT_SUB_DOCUMENT_ELEMENT_NAME
protected String idFieldName
protected String rootIdFieldName
protected String siteFieldName
protected String localIdFieldName
protected String publishingDateFieldName
protected String publishingDateAltFieldName
protected String parentIdFieldName
protected String contentTypeFieldName
protected String containsSubDocumentsAttributeName
protected String subDocumentElementName
public void setIdFieldName(String idFieldName)
public void setRootIdFieldName(String rootIdFieldName)
public void setSiteFieldName(String siteFieldName)
public void setLocalIdFieldName(String localIdFieldName)
public void setPublishingDateFieldName(String publishingDateFieldName)
public void setPublishingDateAltFieldName(String publishingDateAltFieldName)
public void setContentTypeFieldName(String contentTypeFieldName)
public void setParentIdFieldName(String parentIdFieldName)
public void setContainsSubDocumentsAttributeName(String containsSubDocumentsAttributeName)
public void setSubDocumentElementName(String subDocumentElementName)
public boolean parse(org.dom4j.Element element,
String fieldName,
String parentFieldName,
org.apache.solr.common.SolrInputDocument solrDoc,
ElementParserService parserService)
ElementParserparse in interface ElementParserelement - the element to parsefieldName - the field name that should be used for the main Solr field (by default will be the
path of the element in the tree plus the element name)parentFieldName - the field name of the parent elementsolrDoc - the Solr document to add the generated fieldsparserService - the parser service used normally to parse sub elementsCopyright © 2018 CrafterCMS. All rights reserved.