[Groonga-commit] groonga/gcs [master] Don't convert to multiple value type field

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Nov 16 16:44:10 JST 2012


YUKI Hiroshi	2012-11-16 16:44:10 +0900 (Fri, 16 Nov 2012)

  New Revision: 139d5cb71695f97b454bcbbf61ed66f220b9d88a
  https://github.com/groonga/gcs/commit/139d5cb71695f97b454bcbbf61ed66f220b9d88a

  Log:
    Don't convert to multiple value type field

  Modified files:
    lib/database/index-field.js

  Modified: lib/database/index-field.js (+5 -4)
===================================================================
--- lib/database/index-field.js    2012-11-16 16:41:59 +0900 (535795d)
+++ lib/database/index-field.js    2012-11-16 16:44:10 +0900 (72004ca)
@@ -481,25 +481,26 @@ IndexField.prototype = {
 
   changeTypeToSync: function(type) {
     var values = this.domain.dumpSync();
+    var multipleValues = this.multipleValues;
     this.deleteSync();
     this._type = type;
-    this.createSync(true);
+    this.createSync(multipleValues);
     var name = this.columnName;
     values.forEach(function(record) {
       var value = record[name];
       switch (type) {
         case 'text':
-          record[name] = Array.isArray(value) ?
+          record[name] = multipleValues ?
             value.map(this._toText, this) : this._toText(value);
           break;
 
         case 'literal':
-          record[name] = Array.isArray(value) ?
+          record[name] = multipleValues ?
             value.map(this._toLiteral, this) : this._toLiteral(value);
           break;
 
         case 'uint':
-          record[name] = Array.isArray(value) ?
+          record[name] = multipleValues ?
             value.map(this._toUInt, this) : this._toUInt(value);
           break;
       }
-------------- next part --------------
HTML����������������������������...
Download 



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