diff --git a/plugins/ingest/src/main/java/org/elasticsearch/ingest/IngestDocument.java b/plugins/ingest/src/main/java/org/elasticsearch/ingest/IngestDocument.java index 27606090d29..c9e11253c61 100644 --- a/plugins/ingest/src/main/java/org/elasticsearch/ingest/IngestDocument.java +++ b/plugins/ingest/src/main/java/org/elasticsearch/ingest/IngestDocument.java @@ -53,7 +53,7 @@ public final class IngestDocument { * @return the value for the provided path if existing, null otherwise * @throws IllegalArgumentException if the field is present but is not of the type provided as argument. */ - public T getPropertyValue(String path, Class clazz) { + public T getFieldValue(String path, Class clazz) { if (path == null || path.length() == 0) { return null; } @@ -66,22 +66,22 @@ public final class IngestDocument { } String leafKey = pathElements[pathElements.length - 1]; - Object property = innerMap.get(leafKey); - if (property == null) { + Object fieldValue = innerMap.get(leafKey); + if (fieldValue == null) { return null; } - if (clazz.isInstance(property)) { - return clazz.cast(property); + if (clazz.isInstance(fieldValue)) { + return clazz.cast(fieldValue); } - throw new IllegalArgumentException("field [" + path + "] of type [" + property.getClass().getName() + "] cannot be cast to [" + clazz.getName() + "]"); + throw new IllegalArgumentException("field [" + path + "] of type [" + fieldValue.getClass().getName() + "] cannot be cast to [" + clazz.getName() + "]"); } /** * Checks whether the document contains a value for the provided path * @param path The path within the document in dot-notation - * @return true if the document contains a value for the property, false otherwise + * @return true if the document contains a value for the field, false otherwise */ - public boolean hasPropertyValue(String path) { + public boolean hasFieldValue(String path) { if (path == null || path.length() == 0) { return false; } @@ -96,10 +96,10 @@ public final class IngestDocument { } /** - * Removes the property identified by the provided path - * @param path the path of the property to be removed + * Removes the field identified by the provided path + * @param path the path of the field to be removed */ - public void removeProperty(String path) { + public void removeField(String path) { if (path == null || path.length() == 0) { return; } @@ -136,7 +136,7 @@ public final class IngestDocument { * @param path The path within the document in dot-notation * @param value The value to put in for the path key */ - public void setPropertyValue(String path, Object value) { + public void setFieldValue(String path, Object value) { if (path == null || path.length() == 0) { throw new IllegalArgumentException("cannot add null or empty field"); } @@ -175,8 +175,8 @@ public final class IngestDocument { /** * Returns the document. Should be used only for reading. Any change made to the returned map will - * not be reflected to the modified flag. Modify the document instead using {@link #setPropertyValue(String, Object)} - * and {@link #removeProperty(String)} + * not be reflected to the modified flag. Modify the document instead using {@link #setFieldValue(String, Object)} + * and {@link #removeField(String)} */ public Map getSource() { return source; diff --git a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/AbstractStringProcessor.java b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/AbstractStringProcessor.java index 409c67924e9..00cbe73e508 100644 --- a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/AbstractStringProcessor.java +++ b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/AbstractStringProcessor.java @@ -46,11 +46,11 @@ public abstract class AbstractStringProcessor implements Processor { @Override public final void execute(IngestDocument document) { for(String field : fields) { - String val = document.getPropertyValue(field, String.class); + String val = document.getFieldValue(field, String.class); if (val == null) { throw new IllegalArgumentException("field [" + field + "] is null, cannot process it."); } - document.setPropertyValue(field, process(val)); + document.setFieldValue(field, process(val)); } } diff --git a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/add/AddProcessor.java b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/add/AddProcessor.java index e17fa622070..7bbb33a8f57 100644 --- a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/add/AddProcessor.java +++ b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/add/AddProcessor.java @@ -48,7 +48,7 @@ public class AddProcessor implements Processor { @Override public void execute(IngestDocument document) { for(Map.Entry entry : fields.entrySet()) { - document.setPropertyValue(entry.getKey(), entry.getValue()); + document.setFieldValue(entry.getKey(), entry.getValue()); } } diff --git a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/convert/ConvertProcessor.java b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/convert/ConvertProcessor.java index 6ea3a955fd7..769ecb90a4b 100644 --- a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/convert/ConvertProcessor.java +++ b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/convert/ConvertProcessor.java @@ -102,7 +102,7 @@ public class ConvertProcessor implements Processor { public void execute(IngestDocument document) { for(Map.Entry entry : fields.entrySet()) { Type type = entry.getValue(); - Object oldValue = document.getPropertyValue(entry.getKey(), Object.class); + Object oldValue = document.getFieldValue(entry.getKey(), Object.class); Object newValue; if (oldValue == null) { throw new IllegalArgumentException("Field [" + entry.getKey() + "] is null, cannot be converted to type [" + type + "]"); @@ -118,7 +118,7 @@ public class ConvertProcessor implements Processor { } else { newValue = type.convert(oldValue); } - document.setPropertyValue(entry.getKey(), newValue); + document.setFieldValue(entry.getKey(), newValue); } } diff --git a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/date/DateProcessor.java b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/date/DateProcessor.java index 8c5340065ba..a7cd3eb4fbe 100644 --- a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/date/DateProcessor.java +++ b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/date/DateProcessor.java @@ -62,7 +62,7 @@ public final class DateProcessor implements Processor { @Override public void execute(IngestDocument ingestDocument) { - String value = ingestDocument.getPropertyValue(matchField, String.class); + String value = ingestDocument.getFieldValue(matchField, String.class); // TODO(talevy): handle custom timestamp fields DateTime dateTime = null; @@ -80,7 +80,7 @@ public final class DateProcessor implements Processor { throw new IllegalArgumentException("unable to parse date [" + value + "]", lastException); } - ingestDocument.setPropertyValue(targetField, ISODateTimeFormat.dateTime().print(dateTime)); + ingestDocument.setFieldValue(targetField, ISODateTimeFormat.dateTime().print(dateTime)); } @Override diff --git a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/geoip/GeoIpProcessor.java b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/geoip/GeoIpProcessor.java index 400632e828c..5187f731494 100644 --- a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/geoip/GeoIpProcessor.java +++ b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/geoip/GeoIpProcessor.java @@ -61,7 +61,7 @@ public final class GeoIpProcessor implements Processor { @Override public void execute(IngestDocument ingestDocument) { - String ip = ingestDocument.getPropertyValue(sourceField, String.class); + String ip = ingestDocument.getFieldValue(sourceField, String.class); final InetAddress ipAddress; try { ipAddress = InetAddress.getByName(ip); @@ -88,7 +88,7 @@ public final class GeoIpProcessor implements Processor { default: throw new IllegalStateException("Unsupported database type [" + dbReader.getMetadata().getDatabaseType() + "]"); } - ingestDocument.setPropertyValue(targetField, geoData); + ingestDocument.setFieldValue(targetField, geoData); } @Override diff --git a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/grok/GrokProcessor.java b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/grok/GrokProcessor.java index 31440ad9e53..c2cc009ef81 100644 --- a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/grok/GrokProcessor.java +++ b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/grok/GrokProcessor.java @@ -46,12 +46,12 @@ public final class GrokProcessor implements Processor { @Override public void execute(IngestDocument ingestDocument) { - Object field = ingestDocument.getPropertyValue(matchField, Object.class); + Object field = ingestDocument.getFieldValue(matchField, Object.class); // TODO(talevy): handle invalid field types if (field instanceof String) { Map matches = grok.captures((String) field); if (matches != null) { - matches.forEach((k, v) -> ingestDocument.setPropertyValue(k, v)); + matches.forEach((k, v) -> ingestDocument.setFieldValue(k, v)); } } } diff --git a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/gsub/GsubProcessor.java b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/gsub/GsubProcessor.java index d436a888fd7..bbbb7b9cfd4 100644 --- a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/gsub/GsubProcessor.java +++ b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/gsub/GsubProcessor.java @@ -51,13 +51,13 @@ public class GsubProcessor implements Processor { @Override public void execute(IngestDocument document) { for (GsubExpression gsubExpression : gsubExpressions) { - String oldVal = document.getPropertyValue(gsubExpression.getFieldName(), String.class); + String oldVal = document.getFieldValue(gsubExpression.getFieldName(), String.class); if (oldVal == null) { throw new IllegalArgumentException("field [" + gsubExpression.getFieldName() + "] is null, cannot match pattern."); } Matcher matcher = gsubExpression.getPattern().matcher(oldVal); String newVal = matcher.replaceAll(gsubExpression.getReplacement()); - document.setPropertyValue(gsubExpression.getFieldName(), newVal); + document.setFieldValue(gsubExpression.getFieldName(), newVal); } } diff --git a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/join/JoinProcessor.java b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/join/JoinProcessor.java index 283a7ee49f8..a30b43ebde7 100644 --- a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/join/JoinProcessor.java +++ b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/join/JoinProcessor.java @@ -50,14 +50,14 @@ public class JoinProcessor implements Processor { @Override public void execute(IngestDocument document) { for(Map.Entry entry : fields.entrySet()) { - List list = document.getPropertyValue(entry.getKey(), List.class); + List list = document.getFieldValue(entry.getKey(), List.class); if (list == null) { throw new IllegalArgumentException("field [" + entry.getKey() + "] is null, cannot join."); } String joined = list.stream() .map(Object::toString) .collect(Collectors.joining(entry.getValue())); - document.setPropertyValue(entry.getKey(), joined); + document.setFieldValue(entry.getKey(), joined); } } diff --git a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/remove/RemoveProcessor.java b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/remove/RemoveProcessor.java index 744b668a27a..41aba178741 100644 --- a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/remove/RemoveProcessor.java +++ b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/remove/RemoveProcessor.java @@ -49,7 +49,7 @@ public class RemoveProcessor implements Processor { @Override public void execute(IngestDocument document) { for(String field : fields) { - document.removeProperty(field); + document.removeField(field); } } diff --git a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/rename/RenameProcessor.java b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/rename/RenameProcessor.java index f829e7ab0d7..d532564146f 100644 --- a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/rename/RenameProcessor.java +++ b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/rename/RenameProcessor.java @@ -47,13 +47,13 @@ public class RenameProcessor implements Processor { @Override public void execute(IngestDocument document) { for(Map.Entry entry : fields.entrySet()) { - if (document.hasPropertyValue(entry.getKey())) { - if (document.hasPropertyValue(entry.getKey()) == false) { + if (document.hasFieldValue(entry.getKey())) { + if (document.hasFieldValue(entry.getKey()) == false) { throw new IllegalArgumentException("field [" + entry.getKey() + "] doesn't exist"); } - Object oldValue = document.getPropertyValue(entry.getKey(), Object.class); - document.removeProperty(entry.getKey()); - document.setPropertyValue(entry.getValue(), oldValue); + Object oldValue = document.getFieldValue(entry.getKey(), Object.class); + document.removeField(entry.getKey()); + document.setFieldValue(entry.getValue(), oldValue); } } } diff --git a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/split/SplitProcessor.java b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/split/SplitProcessor.java index bc83bc9c794..92e87cc0628 100644 --- a/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/split/SplitProcessor.java +++ b/plugins/ingest/src/main/java/org/elasticsearch/ingest/processor/split/SplitProcessor.java @@ -50,11 +50,11 @@ public class SplitProcessor implements Processor { @Override public void execute(IngestDocument document) { for(Map.Entry entry : fields.entrySet()) { - String oldVal = document.getPropertyValue(entry.getKey(), String.class); + String oldVal = document.getFieldValue(entry.getKey(), String.class); if (oldVal == null) { throw new IllegalArgumentException("field [" + entry.getKey() + "] is null, cannot split."); } - document.setPropertyValue(entry.getKey(), Arrays.asList(oldVal.split(entry.getValue()))); + document.setFieldValue(entry.getKey(), Arrays.asList(oldVal.split(entry.getValue()))); } } diff --git a/plugins/ingest/src/test/java/org/elasticsearch/ingest/IngestDocumentTests.java b/plugins/ingest/src/test/java/org/elasticsearch/ingest/IngestDocumentTests.java index 24073a85526..375e86f71c6 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/ingest/IngestDocumentTests.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/ingest/IngestDocumentTests.java @@ -44,91 +44,91 @@ public class IngestDocumentTests extends ESTestCase { ingestDocument = new IngestDocument("index", "type", "id", document); } - public void testSimpleGetPropertyValue() { - assertThat(ingestDocument.getPropertyValue("foo", String.class), equalTo("bar")); - assertThat(ingestDocument.getPropertyValue("int", Integer.class), equalTo(123)); + public void testSimpleGetFieldValue() { + assertThat(ingestDocument.getFieldValue("foo", String.class), equalTo("bar")); + assertThat(ingestDocument.getFieldValue("int", Integer.class), equalTo(123)); } - public void testGetPropertyValueNullValue() { - assertThat(ingestDocument.getPropertyValue("fizz.foo_null", Object.class), nullValue()); + public void testGetFieldValueNullValue() { + assertThat(ingestDocument.getFieldValue("fizz.foo_null", Object.class), nullValue()); } - public void testSimpleGetPropertyValueTypeMismatch() { + public void testSimpleGetFieldValueTypeMismatch() { try { - ingestDocument.getPropertyValue("int", String.class); - fail("getProperty should have failed"); + ingestDocument.getFieldValue("int", String.class); + fail("getFieldValue should have failed"); } catch(IllegalArgumentException e) { assertThat(e.getMessage(), equalTo("field [int] of type [java.lang.Integer] cannot be cast to [java.lang.String]")); } try { - ingestDocument.getPropertyValue("foo", Integer.class); - fail("getProperty should have failed"); + ingestDocument.getFieldValue("foo", Integer.class); + fail("getFieldValue should have failed"); } catch(IllegalArgumentException e) { assertThat(e.getMessage(), equalTo("field [foo] of type [java.lang.String] cannot be cast to [java.lang.Integer]")); } } - public void testNestedGetPropertyValue() { - assertThat(ingestDocument.getPropertyValue("fizz.buzz", String.class), equalTo("hello world")); + public void testNestedGetFieldValue() { + assertThat(ingestDocument.getFieldValue("fizz.buzz", String.class), equalTo("hello world")); } - public void testGetPropertyValueNotFound() { - assertThat(ingestDocument.getPropertyValue("not.here", String.class), nullValue()); + public void testGetFieldValueNotFound() { + assertThat(ingestDocument.getFieldValue("not.here", String.class), nullValue()); } - public void testGetPropertyValueNull() { - assertNull(ingestDocument.getPropertyValue(null, String.class)); + public void testGetFieldValueNull() { + assertNull(ingestDocument.getFieldValue(null, String.class)); } - public void testGetPropertyValueEmpty() { - assertNull(ingestDocument.getPropertyValue("", String.class)); + public void testGetFieldValueEmpty() { + assertNull(ingestDocument.getFieldValue("", String.class)); } - public void testHasProperty() { - assertTrue(ingestDocument.hasPropertyValue("fizz")); + public void testHasFieldValue() { + assertTrue(ingestDocument.hasFieldValue("fizz")); } - public void testHasPropertyValueNested() { - assertTrue(ingestDocument.hasPropertyValue("fizz.buzz")); + public void testHasFieldValueNested() { + assertTrue(ingestDocument.hasFieldValue("fizz.buzz")); } - public void testHasPropertyValueNotFound() { - assertFalse(ingestDocument.hasPropertyValue("doesnotexist")); + public void testHasFieldValueNotFound() { + assertFalse(ingestDocument.hasFieldValue("doesnotexist")); } - public void testHasPropertyValueNestedNotFound() { - assertFalse(ingestDocument.hasPropertyValue("fizz.doesnotexist")); + public void testHasFieldValueNestedNotFound() { + assertFalse(ingestDocument.hasFieldValue("fizz.doesnotexist")); } - public void testHasPropertyValueNull() { - assertFalse(ingestDocument.hasPropertyValue(null)); + public void testHasFieldValueNull() { + assertFalse(ingestDocument.hasFieldValue(null)); } - public void testHasPropertyValueNullValue() { - assertTrue(ingestDocument.hasPropertyValue("fizz.foo_null")); + public void testHasFieldValueNullValue() { + assertTrue(ingestDocument.hasFieldValue("fizz.foo_null")); } - public void testHasPropertyValueEmpty() { - assertFalse(ingestDocument.hasPropertyValue("")); + public void testHasFieldValueEmpty() { + assertFalse(ingestDocument.hasFieldValue("")); } - public void testSimpleSetPropertyValue() { - ingestDocument.setPropertyValue("new_field", "foo"); + public void testSimpleSetFieldValue() { + ingestDocument.setFieldValue("new_field", "foo"); assertThat(ingestDocument.getSource().get("new_field"), equalTo("foo")); assertThat(ingestDocument.isModified(), equalTo(true)); } - public void testSetPropertyValueNullValue() { - ingestDocument.setPropertyValue("new_field", null); + public void testSetFieldValueNullValue() { + ingestDocument.setFieldValue("new_field", null); assertThat(ingestDocument.getSource().containsKey("new_field"), equalTo(true)); assertThat(ingestDocument.getSource().get("new_field"), nullValue()); assertThat(ingestDocument.isModified(), equalTo(true)); } @SuppressWarnings("unchecked") - public void testNestedSetPropertyValue() { - ingestDocument.setPropertyValue("a.b.c.d", "foo"); + public void testNestedSetFieldValue() { + ingestDocument.setFieldValue("a.b.c.d", "foo"); assertThat(ingestDocument.getSource().get("a"), instanceOf(Map.class)); Map a = (Map) ingestDocument.getSource().get("a"); assertThat(a.get("b"), instanceOf(Map.class)); @@ -141,14 +141,14 @@ public class IngestDocumentTests extends ESTestCase { assertThat(ingestDocument.isModified(), equalTo(true)); } - public void testSetPropertyValueOnExistingField() { - ingestDocument.setPropertyValue("foo", "newbar"); + public void testSetFieldValueOnExistingField() { + ingestDocument.setFieldValue("foo", "newbar"); assertThat(ingestDocument.getSource().get("foo"), equalTo("newbar")); } @SuppressWarnings("unchecked") - public void testSetPropertyValueOnExistingParent() { - ingestDocument.setPropertyValue("fizz.new", "bar"); + public void testSetFieldValueOnExistingParent() { + ingestDocument.setFieldValue("fizz.new", "bar"); assertThat(ingestDocument.getSource().get("fizz"), instanceOf(Map.class)); Map innerMap = (Map) ingestDocument.getSource().get("fizz"); assertThat(innerMap.get("new"), instanceOf(String.class)); @@ -157,9 +157,9 @@ public class IngestDocumentTests extends ESTestCase { assertThat(ingestDocument.isModified(), equalTo(true)); } - public void testSetPropertyValueOnExistingParentTypeMismatch() { + public void testSetFieldValueOnExistingParentTypeMismatch() { try { - ingestDocument.setPropertyValue("fizz.buzz.new", "bar"); + ingestDocument.setFieldValue("fizz.buzz.new", "bar"); fail("add field should have failed"); } catch(IllegalArgumentException e) { assertThat(e.getMessage(), equalTo("cannot add field to parent [buzz] of type [java.lang.String], [java.util.Map] expected instead.")); @@ -167,9 +167,9 @@ public class IngestDocumentTests extends ESTestCase { } } - public void testSetPropertyValueOnExistingNullParent() { + public void testSetFieldValueOnExistingNullParent() { try { - ingestDocument.setPropertyValue("fizz.foo_null.test", "bar"); + ingestDocument.setFieldValue("fizz.foo_null.test", "bar"); fail("add field should have failed"); } catch(IllegalArgumentException e) { assertThat(e.getMessage(), equalTo("cannot add field to null parent, [java.util.Map] expected instead.")); @@ -177,9 +177,9 @@ public class IngestDocumentTests extends ESTestCase { } } - public void testSetPropertyValueNullName() { + public void testSetFieldValueNullName() { try { - ingestDocument.setPropertyValue(null, "bar"); + ingestDocument.setFieldValue(null, "bar"); fail("add field should have failed"); } catch(IllegalArgumentException e) { assertThat(e.getMessage(), equalTo("cannot add null or empty field")); @@ -187,9 +187,9 @@ public class IngestDocumentTests extends ESTestCase { } } - public void testSetPropertyValueEmptyName() { + public void testSetFieldValueEmptyName() { try { - ingestDocument.setPropertyValue("", "bar"); + ingestDocument.setFieldValue("", "bar"); fail("add field should have failed"); } catch(IllegalArgumentException e) { assertThat(e.getMessage(), equalTo("cannot add null or empty field")); @@ -197,15 +197,15 @@ public class IngestDocumentTests extends ESTestCase { } } - public void testRemoveProperty() { - ingestDocument.removeProperty("foo"); + public void testRemoveField() { + ingestDocument.removeField("foo"); assertThat(ingestDocument.isModified(), equalTo(true)); assertThat(ingestDocument.getSource().size(), equalTo(2)); assertThat(ingestDocument.getSource().containsKey("foo"), equalTo(false)); } - public void testRemoveInnerProperty() { - ingestDocument.removeProperty("fizz.buzz"); + public void testRemoveInnerField() { + ingestDocument.removeField("fizz.buzz"); assertThat(ingestDocument.getSource().size(), equalTo(3)); assertThat(ingestDocument.getSource().get("fizz"), instanceOf(Map.class)); @SuppressWarnings("unchecked") @@ -213,33 +213,33 @@ public class IngestDocumentTests extends ESTestCase { assertThat(map.size(), equalTo(1)); assertThat(map.containsKey("buzz"), equalTo(false)); - ingestDocument.removeProperty("fizz.foo_null"); + ingestDocument.removeField("fizz.foo_null"); assertThat(map.size(), equalTo(0)); assertThat(ingestDocument.getSource().size(), equalTo(3)); assertThat(ingestDocument.getSource().containsKey("fizz"), equalTo(true)); assertThat(ingestDocument.isModified(), equalTo(true)); } - public void testRemoveNonExistingProperty() { - ingestDocument.removeProperty("does_not_exist"); + public void testRemoveNonExistingField() { + ingestDocument.removeField("does_not_exist"); assertThat(ingestDocument.isModified(), equalTo(false)); assertThat(ingestDocument.getSource().size(), equalTo(3)); } public void testRemoveExistingParentTypeMismatch() { - ingestDocument.removeProperty("foo.test"); + ingestDocument.removeField("foo.test"); assertThat(ingestDocument.isModified(), equalTo(false)); assertThat(ingestDocument.getSource().size(), equalTo(3)); } - public void testRemoveNullProperty() { - ingestDocument.removeProperty(null); + public void testRemoveNullField() { + ingestDocument.removeField(null); assertThat(ingestDocument.isModified(), equalTo(false)); assertThat(ingestDocument.getSource().size(), equalTo(3)); } - public void testRemoveEmptyProperty() { - ingestDocument.removeProperty(""); + public void testRemoveEmptyField() { + ingestDocument.removeField(""); assertThat(ingestDocument.isModified(), equalTo(false)); assertThat(ingestDocument.getSource().size(), equalTo(3)); } diff --git a/plugins/ingest/src/test/java/org/elasticsearch/ingest/RandomDocumentPicks.java b/plugins/ingest/src/test/java/org/elasticsearch/ingest/RandomDocumentPicks.java index 5277d6b790d..0443dd0b68f 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/ingest/RandomDocumentPicks.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/ingest/RandomDocumentPicks.java @@ -74,7 +74,7 @@ public final class RandomDocumentPicks { randomEntry = RandomPicks.randomFrom(random, treeMap.entrySet()); key += "." + randomEntry.getKey(); } - assert ingestDocument.getPropertyValue(key, Object.class) != null; + assert ingestDocument.getFieldValue(key, Object.class) != null; return key; } @@ -88,7 +88,7 @@ public final class RandomDocumentPicks { do { fieldName = randomFieldName(random); } while (canAddField(fieldName, ingestDocument) == false); - ingestDocument.setPropertyValue(fieldName, value); + ingestDocument.setFieldValue(fieldName, value); return fieldName; } diff --git a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/AbstractStringProcessorTestCase.java b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/AbstractStringProcessorTestCase.java index 94bdce9f663..ecd9fadcef5 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/AbstractStringProcessorTestCase.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/AbstractStringProcessorTestCase.java @@ -53,7 +53,7 @@ public abstract class AbstractStringProcessorTestCase extends ESTestCase { Processor processor = newProcessor(expected.keySet()); processor.execute(ingestDocument); for (Map.Entry entry : expected.entrySet()) { - assertThat(ingestDocument.getPropertyValue(entry.getKey(), String.class), equalTo(entry.getValue())); + assertThat(ingestDocument.getFieldValue(entry.getKey(), String.class), equalTo(entry.getValue())); } } @@ -73,7 +73,7 @@ public abstract class AbstractStringProcessorTestCase extends ESTestCase { String fieldName = RandomDocumentPicks.randomFieldName(random()); Processor processor = newProcessor(Collections.singletonList(fieldName)); IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>()); - ingestDocument.setPropertyValue(fieldName, randomInt()); + ingestDocument.setFieldValue(fieldName, randomInt()); try { processor.execute(ingestDocument); fail("processor should have failed"); diff --git a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/add/AddProcessorTests.java b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/add/AddProcessorTests.java index cecf2c9d9e2..ff32c3e2f05 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/add/AddProcessorTests.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/add/AddProcessorTests.java @@ -44,8 +44,8 @@ public class AddProcessorTests extends ESTestCase { processor.execute(ingestDocument); for (Map.Entry field : fields.entrySet()) { - assertThat(ingestDocument.hasPropertyValue(field.getKey()), equalTo(true)); - assertThat(ingestDocument.getPropertyValue(field.getKey(), Object.class), equalTo(field.getValue())); + assertThat(ingestDocument.hasFieldValue(field.getKey()), equalTo(true)); + assertThat(ingestDocument.getFieldValue(field.getKey(), Object.class), equalTo(field.getValue())); } } @@ -63,14 +63,14 @@ public class AddProcessorTests extends ESTestCase { Processor processor = new AddProcessor(fields); processor.execute(ingestDocument); for (Map.Entry field : fields.entrySet()) { - assertThat(ingestDocument.hasPropertyValue(field.getKey()), equalTo(true)); - assertThat(ingestDocument.getPropertyValue(field.getKey(), Object.class), equalTo(field.getValue())); + assertThat(ingestDocument.hasFieldValue(field.getKey()), equalTo(true)); + assertThat(ingestDocument.getFieldValue(field.getKey(), Object.class), equalTo(field.getValue())); } } public void testAddFieldsTypeMismatch() throws IOException { IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>()); - ingestDocument.setPropertyValue("field", "value"); + ingestDocument.setFieldValue("field", "value"); Processor processor = new AddProcessor(Collections.singletonMap("field.inner", "value")); try { processor.execute(ingestDocument); diff --git a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/convert/ConvertProcessorTests.java b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/convert/ConvertProcessorTests.java index b89f51166df..56d74c6f12a 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/convert/ConvertProcessorTests.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/convert/ConvertProcessorTests.java @@ -46,7 +46,7 @@ public class ConvertProcessorTests extends ESTestCase { Processor processor = new ConvertProcessor(fields); processor.execute(ingestDocument); for (Map.Entry entry : expectedResult.entrySet()) { - assertThat(ingestDocument.getPropertyValue(entry.getKey(), Integer.class), equalTo(entry.getValue())); + assertThat(ingestDocument.getFieldValue(entry.getKey(), Integer.class), equalTo(entry.getValue())); } } @@ -71,7 +71,7 @@ public class ConvertProcessorTests extends ESTestCase { Processor processor = new ConvertProcessor(fields); processor.execute(ingestDocument); for (Map.Entry> entry : expectedResult.entrySet()) { - assertThat(ingestDocument.getPropertyValue(entry.getKey(), List.class), equalTo(entry.getValue())); + assertThat(ingestDocument.getFieldValue(entry.getKey(), List.class), equalTo(entry.getValue())); } } @@ -79,7 +79,7 @@ public class ConvertProcessorTests extends ESTestCase { IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>()); String fieldName = RandomDocumentPicks.randomFieldName(random()); String value = "string-" + randomAsciiOfLengthBetween(1, 10); - ingestDocument.setPropertyValue(fieldName, value); + ingestDocument.setFieldValue(fieldName, value); Map convert = Collections.singletonMap(fieldName, Type.INTEGER); Processor processor = new ConvertProcessor(convert); @@ -106,7 +106,7 @@ public class ConvertProcessorTests extends ESTestCase { Processor processor = new ConvertProcessor(fields); processor.execute(ingestDocument); for (Map.Entry entry : expectedResult.entrySet()) { - assertThat(ingestDocument.getPropertyValue(entry.getKey(), Float.class), equalTo(entry.getValue())); + assertThat(ingestDocument.getFieldValue(entry.getKey(), Float.class), equalTo(entry.getValue())); } } @@ -131,7 +131,7 @@ public class ConvertProcessorTests extends ESTestCase { Processor processor = new ConvertProcessor(fields); processor.execute(ingestDocument); for (Map.Entry> entry : expectedResult.entrySet()) { - assertThat(ingestDocument.getPropertyValue(entry.getKey(), List.class), equalTo(entry.getValue())); + assertThat(ingestDocument.getFieldValue(entry.getKey(), List.class), equalTo(entry.getValue())); } } @@ -139,7 +139,7 @@ public class ConvertProcessorTests extends ESTestCase { IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>()); String fieldName = RandomDocumentPicks.randomFieldName(random()); String value = "string-" + randomAsciiOfLengthBetween(1, 10); - ingestDocument.setPropertyValue(fieldName, value); + ingestDocument.setFieldValue(fieldName, value); Map convert = Collections.singletonMap(fieldName, Type.FLOAT); Processor processor = new ConvertProcessor(convert); @@ -170,7 +170,7 @@ public class ConvertProcessorTests extends ESTestCase { Processor processor = new ConvertProcessor(fields); processor.execute(ingestDocument); for (Map.Entry entry : expectedResult.entrySet()) { - assertThat(ingestDocument.getPropertyValue(entry.getKey(), Boolean.class), equalTo(entry.getValue())); + assertThat(ingestDocument.getFieldValue(entry.getKey(), Boolean.class), equalTo(entry.getValue())); } } @@ -199,7 +199,7 @@ public class ConvertProcessorTests extends ESTestCase { Processor processor = new ConvertProcessor(fields); processor.execute(ingestDocument); for (Map.Entry> entry : expectedResult.entrySet()) { - assertThat(ingestDocument.getPropertyValue(entry.getKey(), List.class), equalTo(entry.getValue())); + assertThat(ingestDocument.getFieldValue(entry.getKey(), List.class), equalTo(entry.getValue())); } } @@ -213,7 +213,7 @@ public class ConvertProcessorTests extends ESTestCase { //verify that only proper boolean values are supported and we are strict about it fieldValue = randomFrom("on", "off", "yes", "no", "0", "1"); } - ingestDocument.setPropertyValue(fieldName, fieldValue); + ingestDocument.setFieldValue(fieldName, fieldValue); Map convert = Collections.singletonMap(fieldName, Type.BOOLEAN); Processor processor = new ConvertProcessor(convert); @@ -260,7 +260,7 @@ public class ConvertProcessorTests extends ESTestCase { Processor processor = new ConvertProcessor(fields); processor.execute(ingestDocument); for (Map.Entry entry : expectedResult.entrySet()) { - assertThat(ingestDocument.getPropertyValue(entry.getKey(), String.class), equalTo(entry.getValue())); + assertThat(ingestDocument.getFieldValue(entry.getKey(), String.class), equalTo(entry.getValue())); } } @@ -305,7 +305,7 @@ public class ConvertProcessorTests extends ESTestCase { Processor processor = new ConvertProcessor(fields); processor.execute(ingestDocument); for (Map.Entry> entry : expectedResult.entrySet()) { - assertThat(ingestDocument.getPropertyValue(entry.getKey(), List.class), equalTo(entry.getValue())); + assertThat(ingestDocument.getFieldValue(entry.getKey(), List.class), equalTo(entry.getValue())); } } diff --git a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/date/DateProcessorTests.java b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/date/DateProcessorTests.java index 10514ee46a9..182ab1dbaaf 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/date/DateProcessorTests.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/date/DateProcessorTests.java @@ -38,7 +38,7 @@ public class DateProcessorTests extends ESTestCase { document.put("date_as_string", "2010 12 06 11:05:15"); IngestDocument ingestDocument = new IngestDocument("index", "type", "id", document); dateProcessor.execute(ingestDocument); - assertThat(ingestDocument.getPropertyValue("date_as_date", String.class), equalTo("2010-06-12T11:05:15.000+02:00")); + assertThat(ingestDocument.getFieldValue("date_as_date", String.class), equalTo("2010-06-12T11:05:15.000+02:00")); } public void testJodaPatternMultipleFormats() { @@ -53,19 +53,19 @@ public class DateProcessorTests extends ESTestCase { document.put("date_as_string", "2010 12 06"); IngestDocument ingestDocument = new IngestDocument("index", "type", "id", document); dateProcessor.execute(ingestDocument); - assertThat(ingestDocument.getPropertyValue("date_as_date", String.class), equalTo("2010-06-12T00:00:00.000+02:00")); + assertThat(ingestDocument.getFieldValue("date_as_date", String.class), equalTo("2010-06-12T00:00:00.000+02:00")); document = new HashMap<>(); document.put("date_as_string", "12/06/2010"); ingestDocument = new IngestDocument("index", "type", "id", document); dateProcessor.execute(ingestDocument); - assertThat(ingestDocument.getPropertyValue("date_as_date", String.class), equalTo("2010-06-12T00:00:00.000+02:00")); + assertThat(ingestDocument.getFieldValue("date_as_date", String.class), equalTo("2010-06-12T00:00:00.000+02:00")); document = new HashMap<>(); document.put("date_as_string", "12-06-2010"); ingestDocument = new IngestDocument("index", "type", "id", document); dateProcessor.execute(ingestDocument); - assertThat(ingestDocument.getPropertyValue("date_as_date", String.class), equalTo("2010-06-12T00:00:00.000+02:00")); + assertThat(ingestDocument.getFieldValue("date_as_date", String.class), equalTo("2010-06-12T00:00:00.000+02:00")); document = new HashMap<>(); document.put("date_as_string", "2010"); @@ -85,7 +85,7 @@ public class DateProcessorTests extends ESTestCase { document.put("date_as_string", "2010 12 giugno"); IngestDocument ingestDocument = new IngestDocument("index", "type", "id", document); dateProcessor.execute(ingestDocument); - assertThat(ingestDocument.getPropertyValue("date_as_date", String.class), equalTo("2010-06-12T00:00:00.000+02:00")); + assertThat(ingestDocument.getFieldValue("date_as_date", String.class), equalTo("2010-06-12T00:00:00.000+02:00")); } public void testJodaPatternDefaultYear() { @@ -95,7 +95,7 @@ public class DateProcessorTests extends ESTestCase { document.put("date_as_string", "12/06"); IngestDocument ingestDocument = new IngestDocument("index", "type", "id", document); dateProcessor.execute(ingestDocument); - assertThat(ingestDocument.getPropertyValue("date_as_date", String.class), equalTo(DateTime.now().getYear() + "-06-12T00:00:00.000+02:00")); + assertThat(ingestDocument.getFieldValue("date_as_date", String.class), equalTo(DateTime.now().getYear() + "-06-12T00:00:00.000+02:00")); } public void testTAI64N() { @@ -106,7 +106,7 @@ public class DateProcessorTests extends ESTestCase { document.put("date_as_string", dateAsString); IngestDocument ingestDocument = new IngestDocument("index", "type", "id", document); dateProcessor.execute(ingestDocument); - assertThat(ingestDocument.getPropertyValue("date_as_date", String.class), equalTo("2012-12-22T03:00:46.767+02:00")); + assertThat(ingestDocument.getFieldValue("date_as_date", String.class), equalTo("2012-12-22T03:00:46.767+02:00")); } public void testUnixMs() { @@ -116,7 +116,7 @@ public class DateProcessorTests extends ESTestCase { document.put("date_as_string", "1000500"); IngestDocument ingestDocument = new IngestDocument("index", "type", "id", document); dateProcessor.execute(ingestDocument); - assertThat(ingestDocument.getPropertyValue("date_as_date", String.class), equalTo("1970-01-01T00:16:40.500Z")); + assertThat(ingestDocument.getFieldValue("date_as_date", String.class), equalTo("1970-01-01T00:16:40.500Z")); } public void testUnix() { @@ -126,6 +126,6 @@ public class DateProcessorTests extends ESTestCase { document.put("date_as_string", "1000.5"); IngestDocument ingestDocument = new IngestDocument("index", "type", "id", document); dateProcessor.execute(ingestDocument); - assertThat(ingestDocument.getPropertyValue("date_as_date", String.class), equalTo("1970-01-01T00:16:40.500Z")); + assertThat(ingestDocument.getFieldValue("date_as_date", String.class), equalTo("1970-01-01T00:16:40.500Z")); } } diff --git a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/gsub/GsubProcessorTests.java b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/gsub/GsubProcessorTests.java index 9dce4fe48c7..7f91a8b3a56 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/gsub/GsubProcessorTests.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/gsub/GsubProcessorTests.java @@ -46,14 +46,14 @@ public class GsubProcessorTests extends ESTestCase { Processor processor = new GsubProcessor(expressions); processor.execute(ingestDocument); for (GsubExpression expression : expressions) { - assertThat(ingestDocument.getPropertyValue(expression.getFieldName(), String.class), equalTo("127-0-0-1")); + assertThat(ingestDocument.getFieldValue(expression.getFieldName(), String.class), equalTo("127-0-0-1")); } } public void testGsubNotAStringValue() throws IOException { IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>()); String fieldName = RandomDocumentPicks.randomFieldName(random()); - ingestDocument.setPropertyValue(fieldName, 123); + ingestDocument.setFieldValue(fieldName, 123); List gsubExpressions = Collections.singletonList(new GsubExpression(fieldName, Pattern.compile("\\."), "-")); Processor processor = new GsubProcessor(gsubExpressions); try { diff --git a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/join/JoinProcessorTests.java b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/join/JoinProcessorTests.java index 8ad6c7bb3c0..391c9a641ea 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/join/JoinProcessorTests.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/join/JoinProcessorTests.java @@ -58,7 +58,7 @@ public class JoinProcessorTests extends ESTestCase { Processor processor = new JoinProcessor(fields); processor.execute(ingestDocument); for (Map.Entry entry : expectedResultMap.entrySet()) { - assertThat(ingestDocument.getPropertyValue(entry.getKey(), String.class), equalTo(entry.getValue())); + assertThat(ingestDocument.getFieldValue(entry.getKey(), String.class), equalTo(entry.getValue())); } } @@ -87,14 +87,14 @@ public class JoinProcessorTests extends ESTestCase { Processor processor = new JoinProcessor(fields); processor.execute(ingestDocument); for (Map.Entry entry : expectedResultMap.entrySet()) { - assertThat(ingestDocument.getPropertyValue(entry.getKey(), String.class), equalTo(entry.getValue())); + assertThat(ingestDocument.getFieldValue(entry.getKey(), String.class), equalTo(entry.getValue())); } } public void testJoinNonListField() throws IOException { IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>()); String fieldName = RandomDocumentPicks.randomFieldName(random()); - ingestDocument.setPropertyValue(fieldName, randomAsciiOfLengthBetween(1, 10)); + ingestDocument.setFieldValue(fieldName, randomAsciiOfLengthBetween(1, 10)); Map join = Collections.singletonMap(fieldName, "-"); Processor processor = new JoinProcessor(join); try { diff --git a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/remove/RemoveProcessorTests.java b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/remove/RemoveProcessorTests.java index 4614ae2f6e1..3c110fd7b60 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/remove/RemoveProcessorTests.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/remove/RemoveProcessorTests.java @@ -45,8 +45,8 @@ public class RemoveProcessorTests extends ESTestCase { Processor processor = new RemoveProcessor(fields); processor.execute(ingestDocument); for (String field : fields) { - assertThat(ingestDocument.getPropertyValue(field, Object.class), nullValue()); - assertThat(ingestDocument.hasPropertyValue(field), equalTo(false)); + assertThat(ingestDocument.getFieldValue(field, Object.class), nullValue()); + assertThat(ingestDocument.hasFieldValue(field), equalTo(false)); } } diff --git a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/rename/RenameProcessorTests.java b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/rename/RenameProcessorTests.java index 65501acb5d3..51ed5da1750 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/rename/RenameProcessorTests.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/rename/RenameProcessorTests.java @@ -46,13 +46,13 @@ public class RenameProcessorTests extends ESTestCase { do { newFieldName = RandomDocumentPicks.randomFieldName(random()); } while (RandomDocumentPicks.canAddField(newFieldName, ingestDocument) == false || newFields.containsKey(newFieldName)); - newFields.put(newFieldName, ingestDocument.getPropertyValue(fieldName, Object.class)); + newFields.put(newFieldName, ingestDocument.getFieldValue(fieldName, Object.class)); fields.put(fieldName, newFieldName); } Processor processor = new RenameProcessor(fields); processor.execute(ingestDocument); for (Map.Entry entry : newFields.entrySet()) { - assertThat(ingestDocument.getPropertyValue(entry.getKey(), Object.class), equalTo(entry.getValue())); + assertThat(ingestDocument.getFieldValue(entry.getKey(), Object.class), equalTo(entry.getValue())); } } @@ -66,12 +66,12 @@ public class RenameProcessorTests extends ESTestCase { public void testRenameExistingFieldNullValue() throws IOException { IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>()); String fieldName = RandomDocumentPicks.randomFieldName(random()); - ingestDocument.setPropertyValue(fieldName, null); + ingestDocument.setFieldValue(fieldName, null); String newFieldName = RandomDocumentPicks.randomFieldName(random()); Processor processor = new RenameProcessor(Collections.singletonMap(fieldName, newFieldName)); processor.execute(ingestDocument); - assertThat(ingestDocument.hasPropertyValue(fieldName), equalTo(false)); - assertThat(ingestDocument.hasPropertyValue(newFieldName), equalTo(true)); - assertThat(ingestDocument.getPropertyValue(newFieldName, Object.class), nullValue()); + assertThat(ingestDocument.hasFieldValue(fieldName), equalTo(false)); + assertThat(ingestDocument.hasFieldValue(newFieldName), equalTo(true)); + assertThat(ingestDocument.getFieldValue(newFieldName, Object.class), nullValue()); } } diff --git a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/split/SplitProcessorTests.java b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/split/SplitProcessorTests.java index 5d749e77e31..14cd6d02a39 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/split/SplitProcessorTests.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/ingest/processor/split/SplitProcessorTests.java @@ -42,7 +42,7 @@ public class SplitProcessorTests extends ESTestCase { Processor processor = new SplitProcessor(fields); processor.execute(ingestDocument); for (String field : fields.keySet()) { - assertThat(ingestDocument.getPropertyValue(field, List.class), equalTo(Arrays.asList("127", "0", "0", "1"))); + assertThat(ingestDocument.getFieldValue(field, List.class), equalTo(Arrays.asList("127", "0", "0", "1"))); } } @@ -62,7 +62,7 @@ public class SplitProcessorTests extends ESTestCase { public void testSplitNonStringValue() throws IOException { IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>()); String fieldName = RandomDocumentPicks.randomFieldName(random()); - ingestDocument.setPropertyValue(fieldName, randomInt()); + ingestDocument.setFieldValue(fieldName, randomInt()); Processor processor = new SplitProcessor(Collections.singletonMap(fieldName, "\\.")); try { processor.execute(ingestDocument); diff --git a/plugins/ingest/src/test/java/org/elasticsearch/plugin/ingest/transport/IngestActionFilterTests.java b/plugins/ingest/src/test/java/org/elasticsearch/plugin/ingest/transport/IngestActionFilterTests.java index 176dd4530b9..974367aec17 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/plugin/ingest/transport/IngestActionFilterTests.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/plugin/ingest/transport/IngestActionFilterTests.java @@ -174,7 +174,7 @@ public class IngestActionFilterTests extends ESTestCase { Processor processor = new Processor() { @Override public void execute(IngestDocument ingestDocument) { - ingestDocument.setPropertyValue("field2", "value2"); + ingestDocument.setFieldValue("field2", "value2"); } @Override