Remove old `content` deprecated field

In #73, we deprecated `content` field in favor of `_content` field.

In plugin version 2.4.0, we can now remove the old field name.

Closes #75.

(cherry picked from commit 7a0f838)
This commit is contained in:
David Pilato 2014-07-26 00:33:31 +02:00
parent e704f68525
commit 6edf3447b1
2 changed files with 1 additions and 5 deletions

View File

@ -393,10 +393,6 @@ public class AttachmentMapper extends AbstractFieldMapper<Object> {
} else if (token == XContentParser.Token.VALUE_STRING) {
if ("_content".equals(currentFieldName)) {
content = parser.binaryValue();
} else if ("content".equals(currentFieldName)) {
// TODO Remove in 2.4.0. See #75 https://github.com/elasticsearch/elasticsearch-mapper-attachments/issues/75
logger.warn("`content` has been deprecated by _content. Please update your code. Will be removed in a future version.");
content = parser.binaryValue();
} else if ("_content_type".equals(currentFieldName)) {
contentType = parser.text();
} else if ("_name".equals(currentFieldName)) {

View File

@ -117,7 +117,7 @@ public class MultifieldAttachmentMapperTests extends ElasticsearchTestCase {
doc = documentMapper.parse("person", "1", XContentFactory.jsonBuilder()
.startObject()
.startObject("file")
.field("content", bytes)
.field("_content", bytes)
.field("_name", forcedName)
.endObject()
.endObject()