You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "yuanyun.cn (JIRA)" <ji...@apache.org> on 2014/02/06 04:20:08 UTC
[jira] [Created] (SOLR-5701) Allow DocTransformer to add arbitrary
fields
yuanyun.cn created SOLR-5701:
--------------------------------
Summary: Allow DocTransformer to add arbitrary fields
Key: SOLR-5701
URL: https://issues.apache.org/jira/browse/SOLR-5701
Project: Solr
Issue Type: Bug
Components: search
Reporter: yuanyun.cn
Fix For: 5.0, 4.7
DocTransformer is very powerful, and allow us to add/remove or update fields before returning.
One limit we don't like is that it can only add one field, and the field name must be [transformer_name].
We may want to add multiple fields in one DocTransformer.
One possible solution is to add method getFieldNames into DocTransformer.
public abstract class DocTransformer{
public void List<String> getFieldNames() { return null; }
}
Then in SolrReturnFields.add(String, NamedList<String>, DocTransformers, SolrQueryRequest)
Change augmenters.addTransformer( factory.create(disp, augmenterParams, req) ); like below:
DocTransformer docTransfomer = factory.create(disp, augmenterParams, req);
SolrReturnFields.add(docTransfomer);
then read fi3eldnames: docTransfomer.getFieldNames(); add them into SolrReturnFields.
DocTransfomer implementation would add all fields via doc.addField.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org