[Groonga-commit] groonga/gcs [master] Fix data response format of vector columns

Back to archive index

Yoji SHIDARA null+****@clear*****
Tue Aug 14 19:40:34 JST 2012


Yoji SHIDARA	2012-08-14 19:40:34 +0900 (Tue, 14 Aug 2012)

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

  Log:
    Fix data response format of vector columns

  Modified files:
    lib/api/2011-02-01/search.js

  Modified: lib/api/2011-02-01/search.js (+7 -1)
===================================================================
--- lib/api/2011-02-01/search.js    2012-08-14 19:30:07 +0900 (e90a59e)
+++ lib/api/2011-02-01/search.js    2012-08-14 19:40:34 +0900 (e5d0671)
@@ -40,7 +40,13 @@ function formatSelectResults(data) {
   var results = records.map(function(record) {
     var object = {};
     columnNames.forEach(function(columnName, index) {
-      object[columnName] = [record[index]];
+      if (Array.isArray(record[index])) {
+        // vector column
+        object[columnName] = record[index];
+      } else {
+        // scalar column
+        object[columnName] = [record[index]];
+      }
     });
     return {
       id: object._key[0],
-------------- next part --------------
HTML����������������������������...
다운로드 



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