public class RenameFieldsIfMultiValuePostProcessor extends Object implements DocumentPostProcessor<org.apache.solr.common.SolrInputDocument>
DocumentPostProcessor
that renames fields that are defined as single value
but that actually have several values, based on a series of suffix mappings. For example, the field name_s
should be single value because of the "_s" suffix. It's multi-value version is "_smv". If the mapping for
_s -> _smv is provided, and there's a name_s
field in the Solr document with multiple values, the field
is renamed to name_smv
.Modifier and Type | Field and Description |
---|---|
protected String |
idFieldName |
protected Map<String,String> |
singleToMultiValueSuffixMappings |
Constructor and Description |
---|
RenameFieldsIfMultiValuePostProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
postProcess(org.apache.solr.common.SolrInputDocument solrDoc)
Processes the specified document to modify or enhance it.
|
protected org.apache.solr.common.SolrInputField |
renameFieldIfMultiValue(String docId,
org.apache.solr.common.SolrInputField field) |
void |
setIdFieldName(String idFieldName) |
void |
setSingleToMultiValueSuffixMappings(Map<String,String> singleToMultiValueSuffixMappings) |
protected String idFieldName
public RenameFieldsIfMultiValuePostProcessor()
public void setIdFieldName(String idFieldName)
public void setSingleToMultiValueSuffixMappings(Map<String,String> singleToMultiValueSuffixMappings)
public void postProcess(org.apache.solr.common.SolrInputDocument solrDoc)
DocumentPostProcessor
postProcess
in interface DocumentPostProcessor<org.apache.solr.common.SolrInputDocument>
solrDoc
- the document to processprotected org.apache.solr.common.SolrInputField renameFieldIfMultiValue(String docId, org.apache.solr.common.SolrInputField field)
Copyright © 2019 CrafterCMS. All rights reserved.