Apache Lucene open-source search software
SOLR-9626: Add css class, when match key is found
Alexandre Rafalovitch380b5ca626b3
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 9ba9eb8abbd..6c2b99c4af8 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -170,6 +170,8 @@ Bug Fixes(Mark Miller, Michael Sun)* SOLR-9729: JDBCStream improvements (Kevin Risden)++* SOLR-9626: new Admin UI now also highlights matched terms in the Analysis screen. (Alexandre Rafalovitch)Other Changes----------------------diff --git a/solr/webapp/web/js/angular/controllers/analysis.js b/solr/webapp/web/js/angular/controllers/analysis.jsindex ccd556aa087..48ec36995f7 100644--- a/solr/webapp/web/js/angular/controllers/analysis.js+++ b/solr/webapp/web/js/angular/controllers/analysis.js@@ -76,9 +76,17 @@ solrAdminApp.controller('AnalysisController',for (key in tokenhash) {if (key == "match" || key=="positionHistory") {- //@ todo do something+ //skip, to not display these keys in the UI} else {- token.keys.push({name:key, value:tokenhash[key]});+ var tokenInfo = new Object();+ tokenInfo.name = key;+ tokenInfo.value = tokenhash[key];+ if ('text' === key || 'raw_bytes' === key ) {+ if (tokenhash.match) {+ tokenInfo.extraclass = 'match'; //to highlight matching text strings+ }+ }+ token.keys.push(tokenInfo);}}tokens.push(token);diff --git a/solr/webapp/web/partials/analysis.html b/solr/webapp/web/partials/analysis.htmlindex 3c1b4565dc5..23527f7351c 100644--- a/solr/webapp/web/partials/analysis.html+++ b/solr/webapp/web/partials/analysis.html@@ -106,7 +106,7 @@ limitations under the License.<td class="details"><table border="0" cellspacing="0" cellpadding="0"><tbody>- <tr class="{{value.name}}" ng-repeat="value in token.keys" ng-show="verbose || value.name=='text'">+ <tr class="{{value.name}} {{value.extraclass}}" ng-repeat="value in token.keys" ng-show="verbose || value.name=='text'"><td>{{value.value}}</td></tr></tbody>