lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Customize Velocity Output, Utility Class or Custom Tool
Date Sun, 04 Aug 2013 16:47:13 GMT
You're in the right place.  There isn't a solr-dev anyway, it's just dev@lucene.

Velocity utilities... great question.  It's not currently supported.  Only the ones listed
in the code pasted below are available (note the TODO).  The catch to supporting pluggable
"tools" in the Velocity context is being able to pick up tools from the Solr resource loader.
 There is no velocity-tools.xml in use in Solr's integration of Velocity - that's a higher
level usage that wasn't used because of the Solr resource loader hurdle, if I recall correctly.

If you're interested and savvy in this area, by all means submit a patch that can load tools
more dynamically.  


    // Velocity context tools - TODO: make these pluggable
    context.put("esc", new EscapeTool());
    context.put("date", new ComparisonDateTool());
    context.put("list", new ListTool());
    context.put("math", new MathTool());
    context.put("number", new NumberTool());
    context.put("sort", new SortTool());
    context.put("engine", engine);  // for $engine.resourceExists(...)

On Aug 2, 2013, at 16:23 , O. Olson wrote:

> Would this question be more appropriate on Solr-Dev?
> Thank you in advance,
> O. O. 
> O. Olson wrote
>> Hi,
>> 	I am using Solr with the VelocityResponseWriter.
>>  I am wondering if
>> there is anyway to add my own Utility Class i.e. how do I put it in the
>> Velocity Context. Or as an alternative to add my own Custom Tool? By the
>> way, where is velocity-tools.xml?
>> Thank you in advance,
>> O. O.
> --
> View this message in context:
> Sent from the Solr - User mailing list archive at

View raw message