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

Provide pluggable Velocity context tool facility

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.3
    • 5.4, 6.0
    • contrib - Velocity
    • None

    Description

      Currently the "tools" placed in the VelocityResponseWriter's context are hard-coded. It can be very handy to be able to plug in 3rd party or custom tools (just any ol' Java object a "tool" can be).

      Here's a list of the currently hard-coded tools: https://github.com/apache/lucene-solr/blob/trunk/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java#L189-L199


      The implementation committed allows custom tools to be registered as part of the VelocityResponseWriter definition in solrconfig.xml like this:

              <queryResponseWriter name="velocityWithCustomTools" class="solr.VelocityResponseWriter">
                <lst name="tools">
                  <str name="mytool">com.example.solr.velocity.MyTool</str>
                  <!-- ... -->
                </lst>
              </queryResponseWriter>
      

      Attachments

        1. SOLR-7915.patch
          9 kB
          Erik Hatcher

        Activity

          People

            ehatcher Erik Hatcher
            ehatcher Erik Hatcher
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: