[Groonga-commit] groonga/groonga-admin at 7b691cd [master] Use text typed indexes for query

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Nov 17 23:18:30 JST 2014


Kouhei Sutou	2014-11-17 23:18:30 +0900 (Mon, 17 Nov 2014)

  New Revision: 7b691cd9dc41aa4f7339c4a8b59aa1231e67b743
  https://github.com/groonga/groonga-admin/commit/7b691cd9dc41aa4f7339c4a8b59aa1231e67b743

  Message:
    Use text typed indexes for query

  Modified files:
    app/scripts/controllers/table-search-controller.js

  Modified: app/scripts/controllers/table-search-controller.js (+26 -2)
===================================================================
--- app/scripts/controllers/table-search-controller.js    2014-11-17 23:16:52 +0900 (10d09d2)
+++ app/scripts/controllers/table-search-controller.js    2014-11-17 23:18:30 +0900 (64bacf7)
@@ -135,6 +135,17 @@ angular.module('groongaAdminApp')
         });
       }
 
+      function isTextType(type) {
+        switch (type) {
+        case 'ShortText':
+        case 'Text':
+        case 'LongText':
+          return true;
+        default:
+          return false;
+        }
+      }
+
       function selectDrilldown(key, value) {
         var queryKey = key;
         var column = $scope.allColumns.find(function(column) {
@@ -218,8 +229,21 @@ angular.module('groongaAdminApp')
             var sourceColumn = $scope.allColumns.find(function(column) {
               return column.name === localName;
             });
-            if (sourceColumn && isTableType(sourceColumn.type)) {
-              indexName += '._key';
+            if (sourceColumn) {
+              var targetType = sourceColumn.type;
+              if (isTableType(targetType)) {
+                var table = $scope.allTables.find(function(table) {
+                  return table.name === targetType;
+                });
+                targetType = table.domain;
+              }
+              if (!isTextType(targetType)) {
+                return;
+              }
+
+              if (isTableType(targetType)) {
+                indexName += '._key';
+              }
             }
 
             var inUse = true;
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index