[Groonga-commit] groonga/gcs [master] Generate index field status without options correctly

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Nov 21 20:40:00 JST 2012


YUKI Hiroshi	2012-11-21 20:40:00 +0900 (Wed, 21 Nov 2012)

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

  Log:
    Generate index field status without options correctly

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

  Modified: lib/api/2011-02-01/configuration.js (+10 -6)
===================================================================
--- lib/api/2011-02-01/configuration.js    2012-11-21 20:37:11 +0900 (376fb4b)
+++ lib/api/2011-02-01/configuration.js    2012-11-21 20:40:00 +0900 (73a2475)
@@ -308,12 +308,16 @@ function createOptionStatus(options) {
 
 function createIndexFieldStatus(options) {
   var indexFieldStatus = xmlbuilder.create();
-  indexFieldStatus.begin(options.element || 'IndexField', { version: '1.0' })
-    .element('Options')
-      .element('IndexFieldName').text(options.field.name).up()
-      .element('IndexFieldType').text(options.field.type).up()
-      .importXMLBuilder(createIndexFieldOptionStatus(options.field))
-    .up()
+  var statusFragment = indexFieldStatus.begin(options.element || 'IndexField', { version: '1.0' });
+
+  var optionsFragment = statusFragment
+        .element('Options')
+          .element('IndexFieldName').text(options.field.name).up()
+          .element('IndexFieldType').text(options.field.type).up();
+  var optionsStatus = createIndexFieldOptionStatus(options.field);
+  if (optionsStatus) optionsFragment.importXMLBuilder(optionsStatus);
+
+  statusFragment
     .importXMLBuilder(createOptionStatus({ field:   options.field,
                                            state:   options.state,
                                            element: 'Status' }));
-------------- next part --------------
HTML����������������������������...
下载 



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