[Groonga-commit] groonga/gcs [master] Output default search domain by gcs-describe-domain (it is an extended behaviour of gcs-version)

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Aug 27 16:25:05 JST 2012


YUKI Hiroshi	2012-08-27 16:25:05 +0900 (Mon, 27 Aug 2012)

  New Revision: 1280c55f626fb6f3340597d39e58814fd07cb8db
  https://github.com/groonga/gcs/commit/1280c55f626fb6f3340597d39e58814fd07cb8db

  Log:
    Output default search domain by gcs-describe-domain (it is an extended behaviour of gcs-version)

  Modified files:
    bin/gcs-describe-domain
    test/gcs-commands.test.js

  Modified: bin/gcs-describe-domain (+5 -0)
===================================================================
--- bin/gcs-describe-domain    2012-08-27 16:22:51 +0900 (b63ef20)
+++ bin/gcs-describe-domain    2012-08-27 16:25:05 +0900 (0ead20a)
@@ -35,6 +35,11 @@ function report(domain) {
                 'IndexDocuments: %s',
               domain.requiresIndexDocuments ? 'Yes' : 'No' );
 
+  // additional information for the default search field!
+  var field = domain.defaultSearchField;
+  if (field)
+    console.log('Default search field: %s', field.name);
+
   console.log('');
   console.log('=== Domain Configuration ===');
 

  Modified: test/gcs-commands.test.js (+22 -0)
===================================================================
--- test/gcs-commands.test.js    2012-08-27 16:22:51 +0900 (10e0451)
+++ test/gcs-commands.test.js    2012-08-27 16:25:05 +0900 (a9a62da)
@@ -811,6 +811,28 @@ suite('gcs-configure-default-search-field', function() {
         done(e);
       });
   });
+
+  test('Described default search field', function(done) {
+    var domain = new Domain('companies', context).createSync();
+    domain.getIndexField('name').setType('text').createSync();
+    utils
+      .run('gcs-configure-default-search-field',
+           '--domain-name', 'companies',
+           '--name', 'name',
+           '--database-path', temporaryDatabase.path)
+      .run('gcs-describe-domain',
+           '--domain-name', 'companies',
+           '--database-path', temporaryDatabase.path)
+      .next(function(result) {
+        assert.equal(result.code, 0, result.output.stdout + result.output.stderr);
+        console.log(result.output.stdout);
+        assert.include(result.output.stdout, 'Default search field: name', result.output.stderr);
+        done();
+      })
+      .error(function(e) {
+        done(e);
+      });
+  });
 });
 
 suite('gcs-index-documents', function() {
-------------- next part --------------
HTML����������������������������...
Download 



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