You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Alexandre Rafalovitch (Jira)" <ji...@apache.org> on 2020/08/29 19:59:00 UTC
[jira] [Resolved] (SOLR-9479) Extends DIH with transformation on
Solr document level
[ https://issues.apache.org/jira/browse/SOLR-9479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexandre Rafalovitch resolved SOLR-9479.
-----------------------------------------
Resolution: Won't Fix
> Extends DIH with transformation on Solr document level
> -------------------------------------------------------
>
> Key: SOLR-9479
> URL: https://issues.apache.org/jira/browse/SOLR-9479
> Project: Solr
> Issue Type: New Feature
> Reporter: Andrey Kudryavtsev
> Priority: Major
> Attachments: SOLR-9479.patch
>
>
> I use DIH to index nested documents.
> I have couple of use cases where field values on parent document depend on children documents values. The simplest one - I need to "propagate" values from all children documents to new field on parent document. It could be a little bit tricky with current DIH architecture when you can apply transformation for "plain" documents which considered as a plain map. See _org.apache.solr.handler.dataimport.Transformer_ (You have to use some kind of "transient fields" in your data-config, this fields are populated from child sources, so sometimes you have to read child sources twice (or more times) for this. Maybe I do it wrong?)
> I decided that maybe it makes sense to be able to apply transformation after nested documents were converted from collection of maps into good old hierarchical SolrInputDocument.
> So this initial patch was created:
> * It introduces concept of _DocumentTransformer_ with Java interface
> {code:java}SolrInputDocument transform(SolrInputDocument solrDoc, Context context) {code}
> * This interface should be implemented by clients transformers. One simple example of such transformer, _PropagationDocumentTransformer_, is implemented. It parametrised by two field names - child and parent, and copied values from children documents to parent document.
> * This kind of transformer should be added into data-config.xml to corresponding parents _entry_:
> {code:xml}documentTransformer="org.apache.solr.handler.dataimport.PropagationDocumentTransformer"{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org