[Groonga-commit] groonga/gcs [master] Receive synonyms directly by updateSynonymsSync()

Back to archive index

null+****@clear***** null+****@clear*****
2012年 8月 9日 (木) 14:40:28 JST


SHIMODA Hiroshi	2012-08-09 14:40:28 +0900 (Thu, 09 Aug 2012)

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

  Log:
    Receive synonyms directly by updateSynonymsSync()

  Modified files:
    lib/api/2011-02-01/configuration.js
    lib/database/domain.js
    test/database-domain.test.js

  Modified: lib/api/2011-02-01/configuration.js (+1 -1)
===================================================================
--- lib/api/2011-02-01/configuration.js    2012-08-09 14:34:46 +0900 (fff22bd)
+++ lib/api/2011-02-01/configuration.js    2012-08-09 14:40:28 +0900 (7e68ec7)
@@ -402,7 +402,7 @@ handlers.UpdateSynonymOptions = function(context, request, response) {
 
     var updatedAt = new Date();
 
-    domain.updateSynonymsSync(synonymOptions);
+    domain.updateSynonymsSync(synonymOptions.synonyms);
 
     response.send(createUpdateSynonymOptionsResponse({
       synonymOptions: JSON.stringify(synonymOptions),

  Modified: lib/database/domain.js (+1 -3)
===================================================================
--- lib/database/domain.js    2012-08-09 14:34:46 +0900 (9b261ec)
+++ lib/database/domain.js    2012-08-09 14:40:28 +0900 (b7860e9)
@@ -273,12 +273,10 @@ Domain.prototype = {
     return formattedSynonyms;
   },
 
-  updateSynonymsSync: function(synonymOptions) {
+  updateSynonymsSync: function(synonyms) {
     if (!this.context)
       throw new Error('no context');
 
-    var synonyms = synonymOptions.synonyms;
-
     try {
       this.context.commandSync('table_remove', {
         table: this.synonymsTableName

  Modified: test/database-domain.test.js (+4 -8)
===================================================================
--- test/database-domain.test.js    2012-08-09 14:34:46 +0900 (24407f1)
+++ test/database-domain.test.js    2012-08-09 14:40:28 +0900 (da77da7)
@@ -307,10 +307,8 @@ suite('database', function() {
         assert.isFalse(domain.isSynonymsTableAvailableSync());
 
         domain.updateSynonymsSync({
-          synonyms: {
-            tokio: ['tokyo'],
-            dekkaido: 'hokkaido'
-          }
+          tokio: ['tokyo'],
+          dekkaido: 'hokkaido'
         });
         assert.isTrue(domain.isSynonymsTableAvailableSync());
 
@@ -334,10 +332,8 @@ suite('database', function() {
       test('getSynonymsSync', function() {
         var domain = new Domain('companies', context);
         domain.updateSynonymsSync({
-          synonyms: {
-            tokio: ['tonkin', 'tokyo'],
-            dekkaido: 'hokkaido'
-          }
+          tokio: ['tonkin', 'tokyo'],
+          dekkaido: 'hokkaido'
         });
 
         var expectedSynonyms = {
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index