SOLR-9626: Add css class, when match key is found

This commit is contained in:
Alexandre Rafalovitch 2016-11-20 22:35:09 +11:00
parent 4ce7ce0844
commit df6d86d5f6
3 changed files with 13 additions and 3 deletions

View File

@ -117,6 +117,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
----------------------

View File

@ -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);

View File

@ -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>