parent
0d570352dd
commit
897fe9108a
|
@ -173,39 +173,6 @@ In the above example, the actual content indexed is mapped under `fields` name `
|
||||||
it will only be available in the `_all` field. The other fields map to their respective metadata names, but there is no
|
it will only be available in the `_all` field. The other fields map to their respective metadata names, but there is no
|
||||||
need to specify the `type` (like `text` or `date`) since it is already known.
|
need to specify the `type` (like `text` or `date`) since it is already known.
|
||||||
|
|
||||||
[[mapper-attachments-copy-to]]
|
|
||||||
==== Copy To feature
|
|
||||||
|
|
||||||
If you want to use https://www.elastic.co/guide/en/elasticsearch/reference/current/copy-to.html[copy_to]
|
|
||||||
feature, you need to define it on each sub-field you want to copy to another field:
|
|
||||||
|
|
||||||
[source,js]
|
|
||||||
--------------------------
|
|
||||||
PUT /test/person/_mapping
|
|
||||||
{
|
|
||||||
"person": {
|
|
||||||
"properties": {
|
|
||||||
"file": {
|
|
||||||
"type": "attachment",
|
|
||||||
"fields": {
|
|
||||||
"content": {
|
|
||||||
"type": "text",
|
|
||||||
"copy_to": "copy"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"copy": {
|
|
||||||
"type": "text"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
--------------------------
|
|
||||||
// CONSOLE
|
|
||||||
|
|
||||||
In this example, the extracted content will be copy as well to `copy` field.
|
|
||||||
|
|
||||||
[[mapper-attachments-querying-metadata]]
|
|
||||||
==== Querying or accessing metadata
|
==== Querying or accessing metadata
|
||||||
|
|
||||||
If you need to query on metadata fields, use the attachment field name dot the metadata field. For example:
|
If you need to query on metadata fields, use the attachment field name dot the metadata field. For example:
|
||||||
|
|
Loading…
Reference in New Issue