[Groonga-commit] groonga/gcs [master] Use TABLE_PAT_KEY instead of TABLE_HASH_KEY for sortable tables

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Nov 1 13:33:07 JST 2012


YUKI Hiroshi	2012-11-01 13:33:07 +0900 (Thu, 01 Nov 2012)

  New Revision: d1aaec73b2d91dfb0d8195fe257afda267167c91
  https://github.com/groonga/gcs/commit/d1aaec73b2d91dfb0d8195fe257afda267167c91

  Log:
    Use TABLE_PAT_KEY instead of TABLE_HASH_KEY for sortable tables

  Modified files:
    lib/database/domain.js
    lib/database/index-field.js
    test/database-domain.test.js
    test/database-index-field.test.js
    test/fixture/companies/ddl-custom-id.grn
    test/fixture/companies/ddl.grn

  Modified: lib/database/domain.js (+1 -1)
===================================================================
--- lib/database/domain.js    2012-11-01 13:25:32 +0900 (caebc1f)
+++ lib/database/domain.js    2012-11-01 13:33:07 +0900 (8f5ebab)
@@ -306,7 +306,7 @@ Domain.prototype = {
 
     this.context.commandSync('table_create', {
       name: this.tableName,
-      flags: nroonga.TABLE_HASH_KEY,
+      flags: nroonga.TABLE_PAT_KEY,
       key_type: nroonga.ShortText
     });
 

  Modified: lib/database/index-field.js (+2 -2)
===================================================================
--- lib/database/index-field.js    2012-11-01 13:25:32 +0900 (553964e)
+++ lib/database/index-field.js    2012-11-01 13:33:07 +0900 (f5756c5)
@@ -271,7 +271,7 @@ IndexField.prototype = {
     if (type == 'uint' || type == 'literal') {
       this.context.commandSync('table_create', {
         name: this.indexTableName,
-        flags: nroonga.TABLE_HASH_KEY,
+        flags: nroonga.TABLE_PAT_KEY,
         key_type: this.indexTableKeyType
       });
       indexTableName = this.indexTableName;
@@ -361,7 +361,7 @@ IndexField.prototype = {
       });
       this.context.commandSync('table_create', {
         name: this.indexTableName,
-        flags: nroonga.TABLE_HASH_KEY,
+        flags: nroonga.TABLE_PAT_KEY,
         key_type: this.indexTableKeyType
       });
       this.context.commandSync('column_create', {

  Modified: test/database-domain.test.js (+3 -3)
===================================================================
--- test/database-domain.test.js    2012-11-01 13:25:32 +0900 (caff485)
+++ test/database-domain.test.js    2012-11-01 13:33:07 +0900 (b83ba1f)
@@ -483,7 +483,7 @@ suite('database', function() {
               tables: domain.tableName
             });
         var expectedDump = 'table_create ' + domain.tableName +  ' ' +
-                             'TABLE_HASH_KEY ShortText\n' +
+                             'TABLE_PAT_KEY ShortText\n' +
                            'table_create ' + domain.configurationsTableName +  ' ' +
                              'TABLE_HASH_KEY ShortText\n' +
                            'column_create ' + domain.configurationsTableName +  ' ' +
@@ -796,7 +796,7 @@ suite('database', function() {
 
         var dumpExpected =
              'table_create ' + domain.tableName +  ' ' +
-               'TABLE_HASH_KEY ShortText\n' +
+               'TABLE_PAT_KEY ShortText\n' +
              'table_create ' + domain.configurationsTableName +  ' ' +
                'TABLE_HASH_KEY ShortText\n' +
              'column_create ' + domain.configurationsTableName + ' ' +
@@ -846,7 +846,7 @@ suite('database', function() {
 
         var dumpExpected =
              'table_create ' + domain.tableName +  ' ' +
-               'TABLE_HASH_KEY ShortText\n' +
+               'TABLE_PAT_KEY ShortText\n' +
              'table_create ' + domain.configurationsTableName +  ' ' +
                'TABLE_HASH_KEY ShortText\n' +
              'column_create ' + domain.configurationsTableName + ' ' +

  Modified: test/database-index-field.test.js (+7 -7)
===================================================================
--- test/database-index-field.test.js    2012-11-01 13:25:32 +0900 (9e52d2b)
+++ test/database-index-field.test.js    2012-11-01 13:33:07 +0900 (ccc845b)
@@ -355,7 +355,7 @@ suite('database', function() {
 
       function getNoColumnDump() {
         return 'table_create ' + domain.tableName +  ' ' +
-                 'TABLE_HASH_KEY ShortText\n' +
+                 'TABLE_PAT_KEY ShortText\n' +
                'table_create ' + domain.configurationsTableName +  ' ' +
                  'TABLE_HASH_KEY ShortText\n' +
                'column_create ' + domain.configurationsTableName +  ' ' +
@@ -380,7 +380,7 @@ suite('database', function() {
               tables: domain.tableName
             });
         var expected = 'table_create ' + domain.tableName +  ' ' +
-                         'TABLE_HASH_KEY ShortText\n' +
+                         'TABLE_PAT_KEY ShortText\n' +
                        'column_create ' + domain.tableName + ' ' +
                          field.columnName + ' COLUMN_SCALAR ShortText\n' +
                        'table_create ' + domain.configurationsTableName +  ' ' +
@@ -427,7 +427,7 @@ suite('database', function() {
               tables: domain.tableName
             });
         var expected = 'table_create ' + domain.tableName + ' ' +
-                         'TABLE_HASH_KEY ShortText\n' +
+                         'TABLE_PAT_KEY ShortText\n' +
                        'column_create ' + domain.tableName + ' ' +
                          field.columnName + ' COLUMN_SCALAR UInt32\n' +
                        'table_create ' + domain.configurationsTableName +  ' ' +
@@ -438,7 +438,7 @@ suite('database', function() {
                          'TABLE_PAT_KEY|KEY_NORMALIZE ShortText ' +
                          '--default_tokenizer TokenBigram\n' +
                        'table_create ' + field.indexTableName + ' ' +
-                         'TABLE_HASH_KEY UInt32\n' +
+                         'TABLE_PAT_KEY UInt32\n' +
                        'column_create ' + field.indexTableName + ' ' +
                          field.indexColumnName + ' ' +
                          'COLUMN_INDEX|WITH_POSITION ' + domain.tableName +
@@ -476,7 +476,7 @@ suite('database', function() {
               tables: 'companies'
             });
         var expected = 'table_create ' + domain.tableName + ' ' +
-                         'TABLE_HASH_KEY ShortText\n' +
+                         'TABLE_PAT_KEY ShortText\n' +
                        'table_create ' + domain.configurationsTableName +  ' ' +
                          'TABLE_HASH_KEY ShortText\n' +
                        'column_create ' + domain.configurationsTableName +  ' ' +
@@ -485,7 +485,7 @@ suite('database', function() {
                          'TABLE_PAT_KEY|KEY_NORMALIZE ShortText ' +
                          '--default_tokenizer TokenBigram\n' +
                        'table_create ' + field.indexTableName + ' ' +
-                         'TABLE_HASH_KEY ShortText\n' +
+                         'TABLE_PAT_KEY ShortText\n' +
                        'column_create ' + field.indexTableName + ' ' +
                          field.indexColumnName + ' ' +
                          'COLUMN_INDEX|WITH_POSITION ' + domain.tableName +
@@ -540,7 +540,7 @@ suite('database', function() {
               tables: domain.tableName
             });
         var expected = 'table_create ' + domain.tableName +  ' ' +
-                         'TABLE_HASH_KEY ShortText\n' +
+                         'TABLE_PAT_KEY ShortText\n' +
                        'column_create ' + domain.tableName + ' ' +
                          field.columnName + ' COLUMN_VECTOR ShortText\n' +
                        'table_create ' + domain.configurationsTableName +  ' ' +

  Modified: test/fixture/companies/ddl-custom-id.grn (+3 -3)
===================================================================
--- test/fixture/companies/ddl-custom-id.grn    2012-11-01 13:25:32 +0900 (fec452d)
+++ test/fixture/companies/ddl-custom-id.grn    2012-11-01 13:33:07 +0900 (984aea5)
@@ -1,9 +1,9 @@
-table_create companies_id0123_index_product TABLE_HASH_KEY ShortText
-table_create companies_id0123_index_age TABLE_HASH_KEY UInt32
+table_create companies_id0123_index_product TABLE_PAT_KEY ShortText
+table_create companies_id0123_index_age TABLE_PAT_KEY UInt32
 table_create companies_id0123_index_BigramTerms TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram
 table_create companies_id0123_configurations TABLE_HASH_KEY ShortText
 column_create companies_id0123_configurations value COLUMN_SCALAR ShortText
-table_create companies_id0123 TABLE_HASH_KEY ShortText
+table_create companies_id0123 TABLE_PAT_KEY ShortText
 column_create companies_id0123 address COLUMN_SCALAR ShortText
 column_create companies_id0123 age COLUMN_SCALAR UInt32
 column_create companies_id0123 description COLUMN_SCALAR ShortText

  Modified: test/fixture/companies/ddl.grn (+3 -3)
===================================================================
--- test/fixture/companies/ddl.grn    2012-11-01 13:25:32 +0900 (ddeff38)
+++ test/fixture/companies/ddl.grn    2012-11-01 13:33:07 +0900 (e5de93c)
@@ -1,9 +1,9 @@
-table_create companies_00000000000000000000000000_index_product TABLE_HASH_KEY ShortText
-table_create companies_00000000000000000000000000_index_age TABLE_HASH_KEY UInt32
+table_create companies_00000000000000000000000000_index_product TABLE_PAT_KEY ShortText
+table_create companies_00000000000000000000000000_index_age TABLE_PAT_KEY UInt32
 table_create companies_00000000000000000000000000_index_BigramTerms TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram
 table_create companies_00000000000000000000000000_configurations TABLE_HASH_KEY ShortText
 column_create companies_00000000000000000000000000_configurations value COLUMN_SCALAR ShortText
-table_create companies_00000000000000000000000000 TABLE_HASH_KEY ShortText
+table_create companies_00000000000000000000000000 TABLE_PAT_KEY ShortText
 column_create companies_00000000000000000000000000 address COLUMN_SCALAR ShortText
 column_create companies_00000000000000000000000000 age COLUMN_SCALAR UInt32
 column_create companies_00000000000000000000000000 description COLUMN_SCALAR ShortText
-------------- next part --------------
HTML����������������������������...
다운로드 



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