What version of Solr? And where is the file you’re changing?
With Solr 5.2, one example of what you’re trying to do is under example/files.
In the README we have this:
bin/solr start
-Dvelocity.template.base.dir=</full/path/to>/example/files/conf/velocity/
When you create a collection it clones the configuration (in 5x; under
server/solr/…) so if you wanted to in-place edit you’d edit those files rather
than the original configuration which would require a collection re-create.
With the above command-line, you can have templates anywhere you like and edit
them in place, and they override any in the configuration of the Solr
collection.
See
https://cwiki.apache.org/confluence/display/solr/Response+Writers#ResponseWriters-VelocityResponseWriter
for perhaps some more details. If there’s any way I can make this easier, let
me know.
If the above info doesn’t work or apply because you’re on a different version
of Solr, provide more details and I’ll help from there.
—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com
> On Jun 8, 2015, at 5:07 PM, Sznajder ForMailingList
> <[email protected]> wrote:
>
> Thanks!!
>
> However, each time I change a *.vm file, I do not succeed to see the change
> on my browser until, I delete + recreate the collectoin and re-index.
>
> Isn't there a way to immediately see the display change?
>
> Best regards
>
> On Mon, Jun 8, 2015 at 11:46 PM, Erik Hatcher <[email protected]>
> wrote:
>
>> Benjamin -
>>
>> The templates for VelocityResponseWriter (/browse, etc) are under
>> conf/velocity. Find the template that generates the piece you want to
>> affect (which may be hit.vm or hit_<something>.vm? - depends on which
>> version of Solr you’re using and which configuration you’ve started with to
>> be more precise) and modify it to render a hyperlink around
>> $doc.getFirstValue(“url”), maybe something like:
>>
>> <a href="$doc.getFirstValue(“url”)”>click here</a>
>>
>> Does that get you what you need?
>>
>> —
>> Erik Hatcher, Senior Solutions Architect
>> http://www.lucidworks.com
>>
>>
>>
>>
>>> On Jun 8, 2015, at 4:29 PM, Sznajder ForMailingList <
>> [email protected]> wrote:
>>>
>>> Hi
>>>
>>> I would like one of the fields, I display in the results of Velocity UI,
>> to
>>> be a hyperlink.
>>>
>>> In my example, I am storing a field "url" containing the link to the
>> online
>>> page of the indexed document and I would like to have this displayed
>> field
>>> a hyperlink to this page.
>>>
>>> Could you please indicate me waht should I change to get that?
>>>
>>> thanks!
>>>
>>> Benjamin
>>
>>