You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by eh...@apache.org on 2014/12/27 11:15:16 UTC
svn commit: r1648042 - in /lucene/dev/branches/branch_5x/solr: ./ CHANGES.txt
contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java
server/solr/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm
Author: ehatcher
Date: Sat Dec 27 10:15:16 2014
New Revision: 1648042
URL: http://svn.apache.org/r1648042
Log:
SOLR-3711: Truncate long strings in /browse field facets
Modified:
lucene/dev/branches/branch_5x/solr/ (props changed)
lucene/dev/branches/branch_5x/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_5x/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java
lucene/dev/branches/branch_5x/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm
Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1648042&r1=1648041&r2=1648042&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Sat Dec 27 10:15:16 2014
@@ -519,6 +519,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
Modified: lucene/dev/branches/branch_5x/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java?rev=1648042&r1=1648041&r2=1648042&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java (original)
+++ lucene/dev/branches/branch_5x/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java Sat Dec 27 10:15:16 2014
@@ -35,6 +35,7 @@ import org.apache.velocity.VelocityConte
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 impl
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(...)
Modified: lucene/dev/branches/branch_5x/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm?rev=1648042&r1=1648041&r2=1648042&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm (original)
+++ lucene/dev/branches/branch_5x/solr/server/solr/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm Sat Dec 27 10:15:16 2014
@@ -13,7 +13,10 @@
<span class="facet-field">$field.name</span>
<ul>
#foreach($facet in $field.values)
- <li><a href="#url_for_facet_filter($field.name, $facet.name)">#if($facet.name!=$null)$facet.name#else<em>missing</em>#end</a> ($facet.count)</li>
+ <li>
+ <a href="#url_for_facet_filter($field.name, $facet.name)" title="$esc.html($facet.name)">
+ #if($facet.name!=$null)$esc.html($display.truncate($facet.name,20))#else<em>missing</em>#end</a> ($facet.count)
+ </li>
#end
</ul>
#end ## end if > 0