You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ar...@apache.org on 2016/11/20 11:35:26 UTC

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

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 4ce7ce084 -> df6d86d5f


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


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/df6d86d5
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/df6d86d5
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/df6d86d5

Branch: refs/heads/branch_6x
Commit: df6d86d5f6d8d9f0eda5f7f818c7a94a9729ddd4
Parents: 4ce7ce0
Author: Alexandre Rafalovitch <ar...@apache.org>
Authored: Sun Nov 20 22:35:09 2016 +1100
Committer: Alexandre Rafalovitch <ar...@apache.org>
Committed: Sun Nov 20 22:35:09 2016 +1100

----------------------------------------------------------------------
 solr/CHANGES.txt                                   |  2 ++
 solr/webapp/web/js/angular/controllers/analysis.js | 12 ++++++++++--
 solr/webapp/web/partials/analysis.html             |  2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/df6d86d5/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 2d26a22..3dd5994 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -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
 ----------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/df6d86d5/solr/webapp/web/js/angular/controllers/analysis.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/angular/controllers/analysis.js b/solr/webapp/web/js/angular/controllers/analysis.js
index ccd556a..48ec369 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);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/df6d86d5/solr/webapp/web/partials/analysis.html
----------------------------------------------------------------------
diff --git a/solr/webapp/web/partials/analysis.html b/solr/webapp/web/partials/analysis.html
index 3c1b456..23527f7 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>