Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

ECS 3.6.2 Data Access Guide

PDF

Use metadata search queries

The metadata search feature provides a rich query language that enables objects that have indexed metadata to be searched.

Table 1. API SyntaxThe syntax is shown in the table below.
API Syntax Response Body
GET /{bucket}/?
query={expression}
&attributes={fieldname,…}
&sorted={selector}
&include_older_version={tru
e|false}
&max-keys=(num_keys)
&marker=(marker value)
NOTE: Prefix capability is added to the metadata search. See Prefix capability in metadata search.
<BucketQueryResult xmlns:ns2="http://s3.amazonaws.com/doc/2006-03-01/">
  <Name>mybucket</Name>
  <Marker/>
  <IsTruncated>false</IsTruncated>
  <MaxKeys>0</MaxKeys>
  <ObjectMatches>
    <object>
      <objectName>file4</objectName>
      <objectId>09998027b1b7fbb21f50e13fabb481a237ba2f60f352d437c8da3c7c1c8d7589</objectId>
      <versionId>0</versionId>
      <queryMds>
        <type>SYSMD</type>
        <mdMap>
          <entry>
            <key>createtime</key>
            <value>1449081778025</value>
          </entry>
          <entry>
            <key>size</key>
            <value>1024</value>
          </entry>
          <entry>
            <key>mtime</key>
            <value>1449081778025</value>
          </entry>
        </mdMap>
      </queryMds>
      <queryMds>
        <type>USERMD</type>
        <mdMap>
          <entry>
            <key>x-amz-meta-INT</key>
            <value>407</value>
          </entry>
          <entry>
            <key>x-amz-meta-STR</key>
            <value>String4</value>
          </entry>
        </mdMap>
      </queryMds>
      <indexKey/>
    </object>
    <object
    ...
    </object>
  </ObjectMatches>
</BucketQueryResult>

The expression keywords and their meanings are listed below:

expression
An expression in the form:
[(]{condition1}[%20[and/or]%20{condition2}][)][%20[and/or]%20…]
Where "condition" is a metadata key name filter in the form:
{selector} {operator}
{argument},
For example:
LastModified > 2018-03-01T11:22:00Z
selector
A searchable key name associated with the bucket.
operator
An operator. One of: ==, >, <, <=, >=
argument
A value that the selector is tested against.
attributes=[fieldname,...]
Specifies any optional object attributes that should be included in the report. Attribute values will be included in the report where that attribute is present on the object. The optional attribute values comprise:
  • ContentEncoding
  • ContentType
  • Retention
  • Expiration
  • Expires
In addition, it is possible to return the non-indexed metadata associated with objects that are returned by the search query. The following:
ALL
Lists both system and user metadata associated with the returned objects.
ALL_SMD
Lists the system metadata associated with the returned objects.
ALL_UMD
Lists the user metadata associated with the returned objects.
sorted=[selector]
Specifies one searchable key name associated with the bucket. The key name must be a key that appears in the expression. In the absence of &sorted=keyname, the output will be sorted according to the first key name that appears in the query expression.
NOTE: If "or" operators are used in the expression, the sort order is indeterminate.
include-older-versions=[true|false]
When S3 versioning is enabled on a bucket, setting this to true will return current and older versions of objects that match the expression. Default is false.
max-keys
The maximum number of objects that match the query that should be returned. If there are more objects than the max-keys, a marker will be returned that can be used to retrieve more matches.
marker
The marker that was returned by a previous query and that indicates the point from which query matches should be returned.

Rate this content

Accurate
Useful
Easy to understand
Was this article helpful?
0/3000 characters
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please select whether the article was helpful or not.
  Comments cannot contain these special characters: <>()\