From: Yehuda Sadeh Date: Thu, 24 Jan 2019 01:55:41 +0000 (-0800) Subject: rgw: es: fix content_type queries X-Git-Tag: v14.1.0~210^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ef91c36fbaf062c538d09af87443568e4b064a02;p=ceph.git rgw: es: fix content_type queries 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 --- diff --git a/src/rgw/rgw_sync_module_es_rest.cc b/src/rgw/rgw_sync_module_es_rest.cc index ef4841d94b84..38da69fadd8b 100644 --- a/src/rgw/rgw_sync_module_es_rest.cc +++ b/src/rgw/rgw_sync_module_es_rest.cc @@ -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);