YUKI Hiroshi
null+****@clear*****
Fri Nov 16 18:26:28 JST 2012
YUKI Hiroshi 2012-11-16 18:26:28 +0900 (Fri, 16 Nov 2012) New Revision: 5a6c5a762df0425f91cb7a3fb8c5bb1144e48435 https://github.com/groonga/gcs/commit/5a6c5a762df0425f91cb7a3fb8c5bb1144e48435 Log: Return specified createdAt/updatedAt prior to index field's value Modified files: lib/api/2011-02-01/configuration.js Modified: lib/api/2011-02-01/configuration.js (+13 -13) =================================================================== --- lib/api/2011-02-01/configuration.js 2012-11-16 18:19:07 +0900 (3823c3c) +++ lib/api/2011-02-01/configuration.js 2012-11-16 18:26:28 +0900 (7ea6f30) @@ -229,14 +229,14 @@ handlers.DescribeDomains = function(context, request, response, config) { response.send(createGenericResponse('DescribeDomains', result, request.id)); }; -function createIndexFieldOptionStatus(options) { - switch (options.field.type) { +function createIndexFieldOptionStatus(field) { + switch (field.type) { case 'text': var textOptions = xmlbuilder.create(); textOptions.begin('TextOptions', { version: '1.0' }) .element('DefaultValue').up() - .element('FacetEnabled').text(options.field.facetEnabled).up() - .element('ResultEnabled').text(options.field.resultEnabled); + .element('FacetEnabled').text(field.facetEnabled).up() + .element('ResultEnabled').text(field.resultEnabled); return textOptions; case 'uint': var uintOptions = xmlbuilder.create(); @@ -247,9 +247,9 @@ function createIndexFieldOptionStatus(options) { var literalOptions = xmlbuilder.create(); literalOptions.begin('LiteralOptions', { version: '1.0' }) .element('DefaultValue').up() - .element('FacetEnabled').text(options.field.facetEnabled).up() - .element('ResultEnabled').text(options.field.resultEnabled).up() - .element('SearchEnabled').text(options.field.searchEnabled); + .element('FacetEnabled').text(field.facetEnabled).up() + .element('ResultEnabled').text(field.resultEnabled).up() + .element('SearchEnabled').text(field.searchEnabled); return literalOptions; } } @@ -257,12 +257,12 @@ function createIndexFieldOptionStatus(options) { function createOptionStatus(options) { var optionStatus = xmlbuilder.create(); optionStatus.begin(options.element || 'Status', { version: '1.0' }) - .element('CreationDate').text(dateFormat(options.field.createdAt, - 'isoUtcDateTime')).up() - .element('State').text(options.field.state || 'RequiresIndexDocuments').up() - .element('UpdateDate').text(dateFormat(options.field.updatedAt, + .element('CreationDate').text(dateFormat(options.createdAt || options.field.createdAt, 'isoUtcDateTime')).up() - .element('UpdateVersion').text(options.updateVersion || '0'); + .element('State').text(options.state || options.field.state || 'RequiresIndexDocuments').up() + .element('UpdateDate').text(dateFormat(options.updatedAt || options.field.updatedAt, + 'isoUtcDateTime')).up() + .element('UpdateVersion').text(options.updateVersion || options.field.updateVersion || '0'); return optionStatus; } @@ -272,7 +272,7 @@ function createIndexFieldStatus(options) { .element('Options') .element('IndexFieldName').text(options.field.name).up() .element('IndexFieldType').text(options.field.type).up() - .importXMLBuilder(createIndexFieldOptionStatus(options)) + .importXMLBuilder(createIndexFieldOptionStatus(options.field)) .up() .importXMLBuilder(createOptionStatus({ field: options.field, updateVersion: options.updateVersion, -------------- next part -------------- HTML����������������������������...ダウンロード