Skip to content

Apache Lucene open-source search software

SOLR-5800: Admin UI - Analysis form doesn't render results correctly when a CharFilter is used

Stefan Matheisd4d2e6f8b5c2
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 773540fed95..a812d2eee75 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -144,6 +144,9 @@ Bug Fixes
* SOLR-5839: ZookeeperInfoServlet does not trim path properly.
(Furkan KAMACI via Mark Miller)
+* SOLR-5800: Admin UI - Analysis form doesn't render results correctly when a
+ CharFilter is used. (steffkes)
+
Optimizations
----------------------
* SOLR-1880: Distributed Search skips GET_FIELDS stage if EXECUTE_QUERY
diff --git a/solr/webapp/web/js/scripts/analysis.js b/solr/webapp/web/js/scripts/analysis.js
index 2fc6e9a5fa1..cc2409cba18 100644
--- a/solr/webapp/web/js/scripts/analysis.js
+++ b/solr/webapp/web/js/scripts/analysis.js
@@ -360,13 +360,19 @@ sammy.get
analysis_data[type][1] = [{ 'text': analysis_data[type][1] }]
}
- var c = analysis_data[type][1].length;
- for( var i = 0; i < c; i++ )
+ for( var i = 1; i < type_length; i += 2 )
{
- global_elements_count = Math.max( analysis_data[type][1][i].position || 0, global_elements_count );
+ var tmp_type_length = analysis_data[type][i].length;
+ for( var j = 0; j < tmp_type_length; j++ )
+ {
+ global_elements_count = Math.max
+ (
+ ( analysis_data[type][i][j].positionHistory || [] )[0] || 1,
+ global_elements_count
+ );
+ }
}
-
var content = '<div class="' + type + '">' + "\n";
content += '<table border="0" cellspacing="0" cellpadding="0">' + "\n";