public class DenormalizingPostProcessor extends Object implements DocumentPostProcessor<org.apache.solr.common.SolrInputDocument>
DocumentPostProcessor
that can "denormalize" the parent and it's children documents,
that means, it copies the fields from the parent to the children and the fields of the children to the parent. This
is very helpful, for example, when you're doing a search on the children, but you need also certain fields from
the parent.Modifier and Type | Field and Description |
---|---|
protected boolean |
copyChildrenFieldsToParent |
protected boolean |
copyParentFieldsToChildren |
static String[] |
DEFAULT_FIELDS_TO_IGNORE |
protected String[] |
fieldsToIgnore |
Constructor and Description |
---|
DenormalizingPostProcessor() |
Modifier and Type | Method and Description |
---|---|
protected void |
copyChildrenFieldsToParent(Collection<org.apache.solr.common.SolrInputField> childrenFields,
org.apache.solr.common.SolrInputDocument parentDoc) |
protected void |
copyParentFieldsToChildren(Collection<org.apache.solr.common.SolrInputField> parentFields,
Collection<org.apache.solr.common.SolrInputDocument> childDocs) |
protected Collection<org.apache.solr.common.SolrInputField> |
getChildrenFields(Collection<org.apache.solr.common.SolrInputDocument> childDocs) |
protected Collection<org.apache.solr.common.SolrInputField> |
getParentFields(org.apache.solr.common.SolrInputDocument parentDoc) |
void |
postProcess(org.apache.solr.common.SolrInputDocument solrDoc)
Processes the specified document to modify or enhance it.
|
void |
setCopyChildrenFieldsToParent(boolean copyChildrenFieldsToParent) |
void |
setCopyParentFieldsToChildren(boolean copyParentFieldsToChildren) |
void |
setFieldsToIgnore(String[] fieldsToIgnore) |
public static final String[] DEFAULT_FIELDS_TO_IGNORE
protected String[] fieldsToIgnore
protected boolean copyChildrenFieldsToParent
protected boolean copyParentFieldsToChildren
public void setFieldsToIgnore(String[] fieldsToIgnore)
public void setCopyChildrenFieldsToParent(boolean copyChildrenFieldsToParent)
public void setCopyParentFieldsToChildren(boolean copyParentFieldsToChildren)
public void postProcess(org.apache.solr.common.SolrInputDocument solrDoc)
DocumentPostProcessor
postProcess
in interface DocumentPostProcessor<org.apache.solr.common.SolrInputDocument>
solrDoc
- the document to processprotected Collection<org.apache.solr.common.SolrInputField> getParentFields(org.apache.solr.common.SolrInputDocument parentDoc)
protected Collection<org.apache.solr.common.SolrInputField> getChildrenFields(Collection<org.apache.solr.common.SolrInputDocument> childDocs)
protected void copyChildrenFieldsToParent(Collection<org.apache.solr.common.SolrInputField> childrenFields, org.apache.solr.common.SolrInputDocument parentDoc)
protected void copyParentFieldsToChildren(Collection<org.apache.solr.common.SolrInputField> parentFields, Collection<org.apache.solr.common.SolrInputDocument> childDocs)
Copyright © 2019 CrafterCMS. All rights reserved.