]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: es: fix content_type queries
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 24 Jan 2019 01:55:41 +0000 (17:55 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 25 Jan 2019 23:45:57 +0000 (15:45 -0800)
Fixes: http://tracker.ceph.com/issues/38030
ES attribute is stored as content_type, while we were searching
for contenttype.

Allow searching by contenttype, content_type, and also lastmodified,
and last_modified.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_sync_module_es_rest.cc

index ef4841d94b84f9430bebc7f22d9eb34f33f55432..38da69fadd8b414c31fffa37de962643fd34cd53 100644 (file)
@@ -182,7 +182,9 @@ void RGWMetadataSearchOp::execute()
                                   { "size", "meta.size" },
                                   { "mtime", "meta.mtime" },
                                   { "lastmodified", "meta.mtime" },
-                                  { "contenttype", "meta.contenttype" },
+                                  { "last_modified", "meta.mtime" },
+                                  { "contenttype", "meta.content_type" },
+                                  { "content_type", "meta.content_type" },
   };
   es_query.set_field_aliases(&aliases);
 
@@ -191,7 +193,7 @@ void RGWMetadataSearchOp::execute()
                                                            {"instance", ESEntityTypeMap::ES_ENTITY_STR},
                                                            {"permissions", ESEntityTypeMap::ES_ENTITY_STR},
                                                            {"meta.etag", ESEntityTypeMap::ES_ENTITY_STR},
-                                                           {"meta.contenttype", ESEntityTypeMap::ES_ENTITY_STR},
+                                                           {"meta.content_type", ESEntityTypeMap::ES_ENTITY_STR},
                                                            {"meta.mtime", ESEntityTypeMap::ES_ENTITY_DATE},
                                                            {"meta.size", ESEntityTypeMap::ES_ENTITY_INT} };
   ESEntityTypeMap gm(generic_map);