End users can assign user metadata to objects using the
x-amz-meta- header. The value assigned can be any text string and is case sensitive, but the metadata names are case insensitive, so
x-amz-meta-FOO,
x-amz-meta-foo are referring to the same field
foo.
NOTE: When defining the fields to index and searching, ensure that you use all lowercase.
When the metadata is indexed so that it can be used as the basis of object searches (the metadata search feature), a datatype is assigned to the data. When writing metadata to objects, clients should write data in the appropriate format so that it can be used correctly in searches.
The datatypes are:
String
If the search index term is marked as text, the metadata string is treated as a string in all search comparisons.
Integer
If the search index term is marked as integer, the metadata string is converted to an integer in search comparisons.
Decimal
If a search index term is marked as decimal, the metadata string is converted to a decimal value so that the "." character is treated as a decimal point.
Datetime
If the search index term is marked as datetime, the metadata string is treated as a date time with the expected format:
yyyy-MM-ddTHH:mm:ssZ If you want the string to be treated as datetime, you need to use the format
yyyy-MM-ddTHH:mm:ssZ when specifying the metadata.
Example
The example below uses the S3 API to upload an object and two user metadata values on the object.