[Groonga-commit] groonga/gcs [master] Simplify codes for IndexDocuments action

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 12日 (木) 19:00:02 JST


SHIMODA Hiroshi	2012-07-12 19:00:02 +0900 (Thu, 12 Jul 2012)

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

  Log:
    Simplify codes for IndexDocuments action

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

  Modified: lib/api/2011-02-01/configuration.js (+4 -10)
===================================================================
--- lib/api/2011-02-01/configuration.js    2012-07-12 18:57:56 +0900 (6c128f7)
+++ lib/api/2011-02-01/configuration.js    2012-07-12 19:00:02 +0900 (b0ab374)
@@ -260,20 +260,14 @@ function createIndexDocumentsResponse(options) {
 
 handlers.IndexDocuments = function(context, request, response) {
   var domain = new Domain(request, context);
-  var indexColumns = context.columnListSync(domain.termsTableName);
-  indexColumns = indexColumns.filter(function(column) {
-                   return column.flags.indexOf(nroonga.COLUMN_INDEX) > -1;
-                 });
+  var indexFieldNames = domain.indexFields.map(function(field) {
+                          return field.name;
+                        });
   try {
     domain.reindexSync();
     response.contentType('application/xml');
     response.send(createIndexDocumentsResponse({
-      // FieldNames must be field names, not column names.
-      // However, original field names are completely lost after
-      // they are created via the API...
-      fieldNames: indexColumns.map(function(column) {
-        return column.source[0].replace(column.range + '.', '');
-      })
+      fieldNames: indexFieldNames
     }));
   } catch(error) {
     var body = createCommonErrorResponse('InternalFailure', error.message);
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index