[Groonga-commit] groonga/gcs [master] Ignore empty domain/index field

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Oct 15 19:04:25 JST 2012


YUKI Hiroshi	2012-10-15 19:04:25 +0900 (Mon, 15 Oct 2012)

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

  Log:
    Ignore empty domain/index field

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

  Modified: lib/api/2011-02-01/configuration.js (+0 -2)
===================================================================
--- lib/api/2011-02-01/configuration.js    2012-10-15 18:59:09 +0900 (1f9690b)
+++ lib/api/2011-02-01/configuration.js    2012-10-15 19:04:25 +0900 (2df62b0)
@@ -307,14 +307,12 @@ handlers.DescribeIndexFields = function(context, request, response, config) {
   var domain = new Domain(request.query.DomainName, context);
 
   try {
-console.log('Object.keys(request.query) = '+Object.keys(request.query));
     var keys = Object.keys(request.query).filter(function(key) {
           return /^FieldNames\.member\.\d+$/.test(key);
         });
     var fieldNames = keys.sort().map(function(key) {
           return request.query[key];
         });
-console.log('fieldNames = '+fieldNames);
     var fields = fieldNames.length ?
                     fieldNames.map(function(name) {
                       return domain.getIndexField(name);

  Modified: lib/command-line.js (+4 -4)
===================================================================
--- lib/command-line.js    2012-10-15 18:59:09 +0900 (c29cf1b)
+++ lib/command-line.js    2012-10-15 19:04:25 +0900 (cafe3f5)
@@ -143,9 +143,9 @@ CommandLineInterface.prototype = {
           self.raiseFatalError(error);
         // awssum cannot operate query options including ".", so we always get all domains...
         domainStatuses = domainStatuses.filter(function(domainStauts) {
-          return domainStatus.DomainName == domainName;
+          return domainStatus && domainStatus.DomainName == domainName;
         });
-        if (domainStatuses.length && domainStatuses[0]) {
+        if (domainStatuses.length) {
           callback(null, domainStatuses[0]);
         } else {
           callback(domainName + ' does not exist. You must specify an existing domain name.', null);
@@ -200,9 +200,9 @@ CommandLineInterface.prototype = {
                       indexFields;
         // awssum cannot operate query options including ".", so we always get all index fields...
         indexFields = indexFields.filter(function(indexField) {
-          return indexField.Options.IndexFieldName == indexFieldName;
+          return indexField && indexField.Options.IndexFieldName == indexFieldName;
         });
-        if (indexFields.length && indexFields[0])
+        if (indexFields.length)
           callback(null, indexFields[0]);
         else
           callback(indexFieldName + ' does not exist.', null);
-------------- next part --------------
HTML����������������������������...
Download 



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