You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Luca Cavanna (Created) (JIRA)" <ji...@apache.org> on 2012/03/02 15:01:58 UTC
[jira] [Created] (SOLR-3189) Removing a field using
TemplateTransformer
Removing a field using TemplateTransformer
------------------------------------------
Key: SOLR-3189
URL: https://issues.apache.org/jira/browse/SOLR-3189
Project: Solr
Issue Type: Improvement
Components: contrib - DataImportHandler
Reporter: Luca Cavanna
Priority: Minor
While importing documents through DataImportHandler I need to remove some fields from the final SolrDocument before it's submitted to Solr.
My usecase: the import query returns an A column which I use to fill in the B field on the Solr instance. My Solr schema contains both the A and B fields, so they are both filled in through dih. I'd like to force the deletion of A from the generated SolrDocument since I need a value only on the B field and want to leave empty the A field. The only way I found is using ScriptTransformer, so I thought it could be useful to add this feature to the TemplateTransformer.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (SOLR-3189) Removing a field using
TemplateTransformer
Posted by "Luca Cavanna (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-3189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Luca Cavanna updated SOLR-3189:
-------------------------------
Attachment: SOLR-3189.patch
Attached patch. It works like this:
{code}
<entity name="row">
<field column="newId" template="${row.id}"/>
<field column="id" remove="true"/>
</entity>
{code}
I introduced the use of the attribute remove. When it's true the template is not required and the field identified by the column name is removed from the resulting SolrDocument.
In the meantime I created a new transformEntityField method for each field in the row, which makes the code more readable in my opinion.
Let me know what you think!
> Removing a field using TemplateTransformer
> ------------------------------------------
>
> Key: SOLR-3189
> URL: https://issues.apache.org/jira/browse/SOLR-3189
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Reporter: Luca Cavanna
> Priority: Minor
> Attachments: SOLR-3189.patch
>
>
> While importing documents through DataImportHandler I need to remove some fields from the final SolrDocument before it's submitted to Solr.
> My usecase: the import query returns an A column which I use to fill in the B field on the Solr instance. My Solr schema contains both the A and B fields, so they are both filled in through dih. I'd like to force the deletion of A from the generated SolrDocument since I need a value only on the B field and want to leave empty the A field. The only way I found is using ScriptTransformer, so I thought it could be useful to add this feature to the TemplateTransformer.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (SOLR-3189) Removing a field using
TemplateTransformer
Posted by "Luca Cavanna (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-3189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13269561#comment-13269561 ]
Luca Cavanna commented on SOLR-3189:
------------------------------------
Guys, don't you think this feature could be useful? Is there something I can do to convince you? :)
> Removing a field using TemplateTransformer
> ------------------------------------------
>
> Key: SOLR-3189
> URL: https://issues.apache.org/jira/browse/SOLR-3189
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Reporter: Luca Cavanna
> Priority: Minor
> Attachments: SOLR-3189.patch
>
>
> While importing documents through DataImportHandler I need to remove some fields from the final SolrDocument before it's submitted to Solr.
> My usecase: the import query returns an A column which I use to fill in the B field on the Solr instance. My Solr schema contains both the A and B fields, so they are both filled in through dih. I'd like to force the deletion of A from the generated SolrDocument since I need a value only on the B field and want to leave empty the A field. The only way I found is using ScriptTransformer, so I thought it could be useful to add this feature to the TemplateTransformer.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org