Navigation Menu

Skip to content

Commit

Permalink
Output default search domain by gcs-describe-domain (it is an extende…
Browse files Browse the repository at this point in the history
…d behaviour of gcs-version)
  • Loading branch information
piroor committed Aug 27, 2012
1 parent 65964b7 commit 1280c55
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/gcs-describe-domain
Expand Up @@ -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 ===');

Expand Down
22 changes: 22 additions & 0 deletions test/gcs-commands.test.js
Expand Up @@ -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() {
Expand Down

0 comments on commit 1280c55

Please sign in to comment.