- Plugins and Integrations: other versions:
- Introduction to plugins
- Plugin Management
- API Extension Plugins
- Alerting Plugins
- Analysis Plugins
- Discovery Plugins
- Management and Site Plugins
- Mapper Plugins
- Scripting Plugins
- Security Plugins
- Snapshot/Restore Repository Plugins
- Transport Plugins
- Integrations
- Help for plugin authors
IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Querying or accessing metadata
editQuerying or accessing metadata
editIf you need to query on metadata fields, use the attachment field name dot the metadata field. For example:
DELETE /test PUT /test PUT /test/person/_mapping { "person": { "properties": { "file": { "type": "attachment", "fields": { "content_type": { "type": "string", "store": true } } } } } } PUT /test/person/1?refresh=true { "file": "IkdvZCBTYXZlIHRoZSBRdWVlbiIgKGFsdGVybmF0aXZlbHkgIkdvZCBTYXZlIHRoZSBLaW5nIg==" } GET /test/person/_search { "fields": [ "file.content_type" ], "query": { "match": { "file.content_type": "text plain" } } }
Will give you:
{ "took": 2, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 1, "max_score": 0.16273327, "hits": [ { "_index": "test", "_type": "person", "_id": "1", "_score": 0.16273327, "fields": { "file.content_type": [ "text/plain; charset=ISO-8859-1" ] } } ] } }
Was this helpful?
Thank you for your feedback.