Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5701

Allow DocTransformer to add arbitrary fields

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 4.9, 6.0
    • search

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            yuanyun.cn jefferyyuan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 72h
                72h
                Remaining:
                Remaining Estimate - 72h
                72h
                Logged:
                Time Spent - Not Specified
                Not Specified