Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy_to not working as expected with the mapper plugin #18361

Closed
sikron opened this issue May 15, 2016 · 2 comments
Closed

copy_to not working as expected with the mapper plugin #18361

sikron opened this issue May 15, 2016 · 2 comments
Labels
>docs General docs changes :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@sikron
Copy link

sikron commented May 15, 2016

Elasticsearch version:
2.3.2

JVM version:
1.7.0_101 x64

OS version:
Ubuntu 14.04

Description of the problem including expected versus actual behavior:
Hi,
i am using Elasticsearch 2.3.2 with the Mapper Attachments Plugin. I try to copy the extracted content to another field, as described here
This is not working for me, though.

I also found a closed bug here #14946. But the discussion does it not make clear, whether the bug has been resolved or not.

Therefore i would be happy, if you could give me a definitive answer, whether this is possible or not.

Steps to reproduce:
curl -XPOST 'http://localhost:9200/test' -d '{
"entry": {
"properties": {
"file": {
"type": "attachment",
"fields": {
"content": {
"type": "string",
"copy_to": "fulltext_en"
}
}
},
"fulltext_en": {
"type": "string",
"analyzer": "english"
}
}
}
}'

curl -XPOST 'http://localhost:9200/test/entry' -d '{
"file": "TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQ="
}'
// the base64 is "Lorem ipsum dolor sit amet"

curl -XPOST 'http://localhost:9200/test/_search' -d '
{
"query": {
"match": {
"fulltext_en": "ipsum"
}
}
}'

the result of the search is then empty, which is wrong, as "ipsum" is contained in the base64.

@clintongormley
Copy link
Contributor

Hi @sikron

Yes, copy_to is no longer allowed on multi-fields as of #10802. In fact, for field types other than attachment, we throw an exception if you try to add copy_to to a multi-field (#15213). This isn't something we can fix in mappings, without introducing a lot of complexity which is likely to carry bugs with it.

The mapper-attachment plugin is deprecated in favour of the ingest-attachment plugin, so this is not something that we're going to fix, but I will remove the docs claiming that we support copy_to.

@sikron
Copy link
Author

sikron commented May 16, 2016

hi, thx for clarification!

@clintongormley clintongormley added :Search Foundations/Mapping Index mappings, including merging and defining field types and removed :Plugin Mapper Attachment labels Feb 13, 2018
@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs General docs changes :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

3 participants