From 9159eede8fbcc3900cd6d23baa9bed746f44f535 Mon Sep 17 00:00:00 2001 From: Erik Hatcher Date: Sat, 27 Dec 2014 10:11:06 +0000 Subject: [PATCH] SOLR-3711: Truncate long strings in /browse field facets git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1648041 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 2 ++ .../org/apache/solr/response/VelocityResponseWriter.java | 2 ++ .../conf/velocity/facet_fields.vm | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 047eecf665f..fee2d77c2d4 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -567,6 +567,8 @@ Other Changes * SOLR-6855: bin/solr -e dih launches, but has some path cruft issues preventing some of the imports don't work (Hossman, Timothy Potter) +* SOLR-3711: Truncate long strings in /browse field facets (ehatcher) + ================== 4.10.3 ================== Bug Fixes diff --git a/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java b/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java index 90508802d9c..892fb67d050 100644 --- a/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java +++ b/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java @@ -35,6 +35,7 @@ import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.runtime.RuntimeConstants; import org.apache.velocity.tools.generic.ComparisonDateTool; +import org.apache.velocity.tools.generic.DisplayTool; import org.apache.velocity.tools.generic.EscapeTool; import org.apache.velocity.tools.generic.ListTool; import org.apache.velocity.tools.generic.MathTool; @@ -87,6 +88,7 @@ public class VelocityResponseWriter implements QueryResponseWriter { context.put("math", new MathTool()); context.put("number", new NumberTool()); context.put("sort", new SortTool()); + context.put("display", new DisplayTool()); context.put("engine", engine); // for $engine.resourceExists(...) diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm b/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm index 57bc210c9d4..292681767b9 100644 --- a/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm +++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm @@ -13,7 +13,10 @@ $field.name #end ## end if > 0