From d4d2e6f8b5c2c06b0c8f960fc4ac5eff3c944576 Mon Sep 17 00:00:00 2001 From: Stefan Matheis Date: Wed, 12 Mar 2014 09:02:20 +0000 Subject: [PATCH] SOLR-5800: Admin UI - Analysis form doesn't render results correctly when a CharFilter is used git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1576652 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 3 +++ solr/webapp/web/js/scripts/analysis.js | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) 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 = '
' + "\n"; content += '' + "\n";