public class SolrDocumentBuilderImpl extends Object implements SolrDocumentBuilder
SolrDocumentBuilder.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ID_FIELD_NAME |
static String |
DEFAULT_LOCAL_ID_FIELD_NAME |
static String |
DEFAULT_PUBLISHING_DATE_ALT_FIELD_NAME |
static String |
DEFAULT_PUBLISHING_DATE_FIELD_NAME |
static String |
DEFAULT_ROOT_ID_FIELD_NAME |
static String |
DEFAULT_SITE_FIELD_NAME |
protected FieldValueConverter |
fieldValueConverter |
protected String |
idFieldName |
protected String |
localIdFieldName |
protected ElementParserService |
parserService |
protected List<SolrDocumentPostProcessor> |
postProcessors |
protected String |
publishingDateAltFieldName |
protected String |
publishingDateFieldName |
protected String |
rootIdFieldName |
protected String |
siteFieldName |
| Constructor and Description |
|---|
SolrDocumentBuilderImpl() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.solr.common.SolrInputDocument |
build(String site,
String id,
Map<String,List<String>> fields)
Builds a Solr document from the provided multi value map of fields
|
org.apache.solr.common.SolrInputDocument |
build(String site,
String id,
String xml,
boolean ignoreRootInFieldNames)
Builds a Solr document from the input XML.
|
org.apache.solr.common.params.ModifiableSolrParams |
buildParams(String site,
String id,
String prefix,
String suffix,
Map<String,List<String>> fields)
Builds a set of SolrParams for an update request from the provided multi value map of fields
|
protected org.dom4j.io.SAXReader |
createSAXReader() |
protected String |
formatAsIso(org.joda.time.DateTime dateTime) |
protected void |
postProcess(org.apache.solr.common.SolrInputDocument solrDoc) |
void |
setFieldValueConverter(FieldValueConverter fieldValueConverter) |
void |
setIdFieldName(String idFieldName) |
void |
setLocalIdFieldName(String localIdFieldName) |
void |
setParserService(ElementParserService parserService) |
void |
setPostProcessors(List<SolrDocumentPostProcessor> postProcessors) |
void |
setPublishingDateAltFieldName(String publishingDateAltFieldName) |
void |
setPublishingDateFieldName(String publishingDateFieldName) |
void |
setRootIdFieldName(String rootIdFieldName) |
void |
setSiteFieldName(String siteFieldName) |
public static final String DEFAULT_ID_FIELD_NAME
public static final String DEFAULT_ROOT_ID_FIELD_NAME
public static final String DEFAULT_SITE_FIELD_NAME
public static final String DEFAULT_LOCAL_ID_FIELD_NAME
public static final String DEFAULT_PUBLISHING_DATE_FIELD_NAME
public static final String DEFAULT_PUBLISHING_DATE_ALT_FIELD_NAME
protected String idFieldName
protected String rootIdFieldName
protected String siteFieldName
protected String localIdFieldName
protected String publishingDateFieldName
protected String publishingDateAltFieldName
protected ElementParserService parserService
protected FieldValueConverter fieldValueConverter
protected List<SolrDocumentPostProcessor> postProcessors
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 setParserService(ElementParserService parserService)
public void setFieldValueConverter(FieldValueConverter fieldValueConverter)
public void setPostProcessors(List<SolrDocumentPostProcessor> postProcessors)
public org.apache.solr.common.SolrInputDocument build(String site, String id, String xml, boolean ignoreRootInFieldNames) throws SolrDocumentBuildException
SolrDocumentBuilderbuild in interface SolrDocumentBuildersite - the Crafter site name the content belongs toid - value for the "localId" field in the Solr document (final doc id is built as
site:localId)xml - the input XMLignoreRootInFieldNames - ignore the root element of the input XML in field namesSolrDocumentBuildExceptionpublic org.apache.solr.common.SolrInputDocument build(String site, String id, Map<String,List<String>> fields)
SolrDocumentBuilderbuild in interface SolrDocumentBuildersite - the Crafter site name the content belongs toid - value for the "localId" field in the Solr document (final doc id is built as site:localId)fields - fields to add to solr document.public org.apache.solr.common.params.ModifiableSolrParams buildParams(String site, String id, String prefix, String suffix, Map<String,List<String>> fields)
SolrDocumentBuilderbuildParams in interface SolrDocumentBuildersite - the Crafter site name the content belongs toid - value for the "localId" field in the Solr document (final doc id is built as site:localId)prefix - the common prefix for the fields (null or empty for no prefix)suffix - the common suffix for the fields (null or empty for no suffix)fields - fields to add to solr document.protected void postProcess(org.apache.solr.common.SolrInputDocument solrDoc)
protected org.dom4j.io.SAXReader createSAXReader()
protected String formatAsIso(org.joda.time.DateTime dateTime)
Copyright © 2018 CrafterCMS. All rights reserved.