diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessPlugin.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessPlugin.java index cdd55b60d7f64..bab73f746fa8f 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessPlugin.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessPlugin.java @@ -37,13 +37,13 @@ import org.elasticsearch.repositories.RepositoriesService; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestHandler; -import org.elasticsearch.runtimefields.mapper.BooleanFieldScript; -import org.elasticsearch.runtimefields.mapper.DateFieldScript; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; -import org.elasticsearch.runtimefields.mapper.GeoPointFieldScript; -import org.elasticsearch.runtimefields.mapper.IpFieldScript; -import org.elasticsearch.runtimefields.mapper.LongFieldScript; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.BooleanFieldScript; +import org.elasticsearch.script.DateFieldScript; +import org.elasticsearch.script.DoubleFieldScript; +import org.elasticsearch.script.GeoPointFieldScript; +import org.elasticsearch.script.IpFieldScript; +import org.elasticsearch.script.LongFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.IngestScript; import org.elasticsearch.script.ScoreScript; import org.elasticsearch.script.ScriptContext; @@ -118,7 +118,7 @@ public final class PainlessPlugin extends Plugin implements ScriptPlugin, Extens private static List getRuntimeFieldWhitelist(String fieldType) { List scriptField = new ArrayList<>(Whitelist.BASE_WHITELISTS); Whitelist whitelist = WhitelistLoader.loadFromResourceFiles(Whitelist.class, - "org.elasticsearch.runtimefields." + fieldType + ".txt"); + "org.elasticsearch.script." + fieldType + ".txt"); scriptField.add(whitelist); return scriptField; } diff --git a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.boolean.txt b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.boolean.txt similarity index 63% rename from modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.boolean.txt rename to modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.boolean.txt index 3f1fc1aaa643e..ffc61be086208 100644 --- a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.boolean.txt +++ b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.boolean.txt @@ -9,13 +9,13 @@ # The whitelist for boolean-valued runtime fields # These two whitelists are required for painless to find the classes -class org.elasticsearch.runtimefields.mapper.BooleanFieldScript @no_import { +class org.elasticsearch.script.BooleanFieldScript @no_import { } -class org.elasticsearch.runtimefields.mapper.BooleanFieldScript$Factory @no_import { +class org.elasticsearch.script.BooleanFieldScript$Factory @no_import { } static_import { # The `emit` callback to collect values for the field - void emit(org.elasticsearch.runtimefields.mapper.BooleanFieldScript, boolean) bound_to org.elasticsearch.runtimefields.mapper.BooleanFieldScript$Emit + void emit(org.elasticsearch.script.BooleanFieldScript, boolean) bound_to org.elasticsearch.script.BooleanFieldScript$Emit } diff --git a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.date.txt b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.date.txt similarity index 57% rename from modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.date.txt rename to modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.date.txt index d4c734f0dc91a..dca45c308acd4 100644 --- a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.date.txt +++ b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.date.txt @@ -9,16 +9,16 @@ # The whitelist for date-valued runtime fields # These two whitelists are required for painless to find the classes -class org.elasticsearch.runtimefields.mapper.DateFieldScript @no_import { +class org.elasticsearch.script.DateFieldScript @no_import { } -class org.elasticsearch.runtimefields.mapper.DateFieldScript$Factory @no_import { +class org.elasticsearch.script.DateFieldScript$Factory @no_import { } static_import { # The `emit` callback to collect values for the field - void emit(org.elasticsearch.runtimefields.mapper.DateFieldScript, long) bound_to org.elasticsearch.runtimefields.mapper.DateFieldScript$Emit + void emit(org.elasticsearch.script.DateFieldScript, long) bound_to org.elasticsearch.script.DateFieldScript$Emit # Parse a value from the source to millis since epoch - long parse(org.elasticsearch.runtimefields.mapper.DateFieldScript, def) bound_to org.elasticsearch.runtimefields.mapper.DateFieldScript$Parse + long parse(org.elasticsearch.script.DateFieldScript, def) bound_to org.elasticsearch.script.DateFieldScript$Parse } diff --git a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.double.txt b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.double.txt similarity index 63% rename from modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.double.txt rename to modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.double.txt index 71a40dab06e56..394c333027d06 100644 --- a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.double.txt +++ b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.double.txt @@ -9,13 +9,13 @@ # The whitelist for double-valued runtime fields # These two whitelists are required for painless to find the classes -class org.elasticsearch.runtimefields.mapper.DoubleFieldScript @no_import { +class org.elasticsearch.script.DoubleFieldScript @no_import { } -class org.elasticsearch.runtimefields.mapper.DoubleFieldScript$Factory @no_import { +class org.elasticsearch.script.DoubleFieldScript$Factory @no_import { } static_import { # The `emit` callback to collect values for the field - void emit(org.elasticsearch.runtimefields.mapper.DoubleFieldScript, double) bound_to org.elasticsearch.runtimefields.mapper.DoubleFieldScript$Emit + void emit(org.elasticsearch.script.DoubleFieldScript, double) bound_to org.elasticsearch.script.DoubleFieldScript$Emit } diff --git a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.ip.txt b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.geopoint.txt similarity index 65% rename from modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.ip.txt rename to modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.geopoint.txt index a88c01c0f2e09..2cf8961b434ca 100644 --- a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.ip.txt +++ b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.geopoint.txt @@ -9,12 +9,12 @@ # The whitelist for ip-valued runtime fields # These two whitelists are required for painless to find the classes -class org.elasticsearch.runtimefields.mapper.IpFieldScript @no_import { +class org.elasticsearch.script.GeoPointFieldScript @no_import { } -class org.elasticsearch.runtimefields.mapper.IpFieldScript$Factory @no_import { +class org.elasticsearch.script.GeoPointFieldScript$Factory @no_import { } static_import { # The `emit` callback to collect values for the field - void emit(org.elasticsearch.runtimefields.mapper.IpFieldScript, String) bound_to org.elasticsearch.runtimefields.mapper.IpFieldScript$Emit + void emit(org.elasticsearch.script.GeoPointFieldScript, double, double) bound_to org.elasticsearch.script.GeoPointFieldScript$Emit } diff --git a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.geopoint.txt b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.ip.txt similarity index 62% rename from modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.geopoint.txt rename to modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.ip.txt index e89f871309d61..dd17ccf34f480 100644 --- a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.geopoint.txt +++ b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.ip.txt @@ -9,12 +9,12 @@ # The whitelist for ip-valued runtime fields # These two whitelists are required for painless to find the classes -class org.elasticsearch.runtimefields.mapper.GeoPointFieldScript @no_import { +class org.elasticsearch.script.IpFieldScript @no_import { } -class org.elasticsearch.runtimefields.mapper.GeoPointFieldScript$Factory @no_import { +class org.elasticsearch.script.IpFieldScript$Factory @no_import { } static_import { # The `emit` callback to collect values for the field - void emit(org.elasticsearch.runtimefields.mapper.GeoPointFieldScript, double, double) bound_to org.elasticsearch.runtimefields.mapper.GeoPointFieldScript$Emit + void emit(org.elasticsearch.script.IpFieldScript, String) bound_to org.elasticsearch.script.IpFieldScript$Emit } diff --git a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.long.txt b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.long.txt similarity index 64% rename from modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.long.txt rename to modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.long.txt index a8919b8d36a31..138f89d78d393 100644 --- a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.long.txt +++ b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.long.txt @@ -9,12 +9,12 @@ # The whitelist for long-valued runtime fields # These two whitelists are required for painless to find the classes -class org.elasticsearch.runtimefields.mapper.LongFieldScript @no_import { +class org.elasticsearch.script.LongFieldScript @no_import { } -class org.elasticsearch.runtimefields.mapper.LongFieldScript$Factory @no_import { +class org.elasticsearch.script.LongFieldScript$Factory @no_import { } static_import { # The `emit` callback to collect values for the field - void emit(org.elasticsearch.runtimefields.mapper.LongFieldScript, long) bound_to org.elasticsearch.runtimefields.mapper.LongFieldScript$Emit + void emit(org.elasticsearch.script.LongFieldScript, long) bound_to org.elasticsearch.script.LongFieldScript$Emit } diff --git a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.string.txt b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.string.txt similarity index 63% rename from modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.string.txt rename to modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.string.txt index e70a128f255ce..f5a1b7a50fbef 100644 --- a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.runtimefields.string.txt +++ b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/org.elasticsearch.script.string.txt @@ -9,12 +9,12 @@ # The whitelist for string-valued runtime fields # These two whitelists are required for painless to find the classes -class org.elasticsearch.runtimefields.mapper.StringFieldScript @no_import { +class org.elasticsearch.script.StringFieldScript @no_import { } -class org.elasticsearch.runtimefields.mapper.StringFieldScript$Factory @no_import { +class org.elasticsearch.script.StringFieldScript$Factory @no_import { } static_import { # The `emit` callback to collect values for the field - void emit(org.elasticsearch.runtimefields.mapper.StringFieldScript, String) bound_to org.elasticsearch.runtimefields.mapper.StringFieldScript$Emit + void emit(org.elasticsearch.script.StringFieldScript, String) bound_to org.elasticsearch.script.StringFieldScript$Emit } diff --git a/modules/runtime-fields-common/src/main/java/org/elasticsearch/runtimefields/RuntimeFieldsPainlessExtension.java b/modules/runtime-fields-common/src/main/java/org/elasticsearch/runtimefields/RuntimeFieldsPainlessExtension.java index b5ef84751938a..04a9f5ddcf7c9 100644 --- a/modules/runtime-fields-common/src/main/java/org/elasticsearch/runtimefields/RuntimeFieldsPainlessExtension.java +++ b/modules/runtime-fields-common/src/main/java/org/elasticsearch/runtimefields/RuntimeFieldsPainlessExtension.java @@ -13,14 +13,14 @@ import org.elasticsearch.painless.spi.WhitelistInstanceBinding; import org.elasticsearch.painless.spi.WhitelistLoader; import org.elasticsearch.painless.spi.annotation.CompileTimeOnlyAnnotation; -import org.elasticsearch.runtimefields.mapper.AbstractFieldScript; -import org.elasticsearch.runtimefields.mapper.BooleanFieldScript; -import org.elasticsearch.runtimefields.mapper.DateFieldScript; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; -import org.elasticsearch.runtimefields.mapper.GeoPointFieldScript; -import org.elasticsearch.runtimefields.mapper.IpFieldScript; -import org.elasticsearch.runtimefields.mapper.LongFieldScript; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.AbstractFieldScript; +import org.elasticsearch.script.BooleanFieldScript; +import org.elasticsearch.script.DateFieldScript; +import org.elasticsearch.script.DoubleFieldScript; +import org.elasticsearch.script.GeoPointFieldScript; +import org.elasticsearch.script.IpFieldScript; +import org.elasticsearch.script.LongFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.ScriptContext; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/BinaryScriptFieldData.java b/server/src/main/java/org/elasticsearch/index/fielddata/BinaryScriptFieldData.java similarity index 93% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/BinaryScriptFieldData.java rename to server/src/main/java/org/elasticsearch/index/fielddata/BinaryScriptFieldData.java index 9fc2d7acdba17..cf44e1ba147ef 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/BinaryScriptFieldData.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/BinaryScriptFieldData.java @@ -6,14 +6,12 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.search.SortField; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.index.fielddata.IndexFieldData; -import org.elasticsearch.index.fielddata.LeafFieldData; import org.elasticsearch.index.fielddata.fieldcomparator.BytesRefFieldComparatorSource; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.MultiValueMode; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/BooleanScriptDocValues.java b/server/src/main/java/org/elasticsearch/index/fielddata/BooleanScriptDocValues.java similarity index 84% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/BooleanScriptDocValues.java rename to server/src/main/java/org/elasticsearch/index/fielddata/BooleanScriptDocValues.java index 4b94d29595c21..4574c393a7a5d 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/BooleanScriptDocValues.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/BooleanScriptDocValues.java @@ -6,10 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; -import org.elasticsearch.index.fielddata.AbstractSortedNumericDocValues; -import org.elasticsearch.runtimefields.mapper.BooleanFieldScript; +import org.elasticsearch.script.BooleanFieldScript; public final class BooleanScriptDocValues extends AbstractSortedNumericDocValues { private final BooleanFieldScript script; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/BooleanScriptFieldData.java b/server/src/main/java/org/elasticsearch/index/fielddata/BooleanScriptFieldData.java similarity index 91% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/BooleanScriptFieldData.java rename to server/src/main/java/org/elasticsearch/index/fielddata/BooleanScriptFieldData.java index b601a34e879d2..2e9b5ac45cdc3 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/BooleanScriptFieldData.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/BooleanScriptFieldData.java @@ -6,17 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.SortedNumericDocValues; import org.elasticsearch.ExceptionsHelper; -import org.elasticsearch.index.fielddata.IndexFieldData; -import org.elasticsearch.index.fielddata.IndexFieldDataCache; -import org.elasticsearch.index.fielddata.IndexNumericFieldData; import org.elasticsearch.index.fielddata.plain.LeafLongFieldData; import org.elasticsearch.indices.breaker.CircuitBreakerService; -import org.elasticsearch.runtimefields.mapper.BooleanFieldScript; +import org.elasticsearch.script.BooleanFieldScript; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.aggregations.support.ValuesSourceType; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/DateScriptFieldData.java b/server/src/main/java/org/elasticsearch/index/fielddata/DateScriptFieldData.java similarity index 90% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/DateScriptFieldData.java rename to server/src/main/java/org/elasticsearch/index/fielddata/DateScriptFieldData.java index f530083e8c3e6..0ddc19024e86f 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/DateScriptFieldData.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/DateScriptFieldData.java @@ -6,17 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.SortedNumericDocValues; import org.elasticsearch.ExceptionsHelper; -import org.elasticsearch.index.fielddata.IndexFieldData; -import org.elasticsearch.index.fielddata.IndexFieldDataCache; -import org.elasticsearch.index.fielddata.IndexNumericFieldData; import org.elasticsearch.index.fielddata.plain.LeafLongFieldData; import org.elasticsearch.indices.breaker.CircuitBreakerService; -import org.elasticsearch.runtimefields.mapper.DateFieldScript; +import org.elasticsearch.script.DateFieldScript; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.aggregations.support.ValuesSourceType; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/DoubleScriptDocValues.java b/server/src/main/java/org/elasticsearch/index/fielddata/DoubleScriptDocValues.java similarity index 85% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/DoubleScriptDocValues.java rename to server/src/main/java/org/elasticsearch/index/fielddata/DoubleScriptDocValues.java index 0fccc46052caa..8b0fea8027147 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/DoubleScriptDocValues.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/DoubleScriptDocValues.java @@ -6,10 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; -import org.elasticsearch.index.fielddata.SortedNumericDoubleValues; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; +import org.elasticsearch.script.DoubleFieldScript; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/DoubleScriptFieldData.java b/server/src/main/java/org/elasticsearch/index/fielddata/DoubleScriptFieldData.java similarity index 89% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/DoubleScriptFieldData.java rename to server/src/main/java/org/elasticsearch/index/fielddata/DoubleScriptFieldData.java index 5c9887e6db2d3..f052af2a7aebc 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/DoubleScriptFieldData.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/DoubleScriptFieldData.java @@ -6,17 +6,13 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; import org.apache.lucene.index.LeafReaderContext; import org.elasticsearch.ExceptionsHelper; -import org.elasticsearch.index.fielddata.IndexFieldData; -import org.elasticsearch.index.fielddata.IndexFieldDataCache; -import org.elasticsearch.index.fielddata.IndexNumericFieldData; -import org.elasticsearch.index.fielddata.SortedNumericDoubleValues; import org.elasticsearch.index.fielddata.plain.LeafDoubleFieldData; import org.elasticsearch.indices.breaker.CircuitBreakerService; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; +import org.elasticsearch.script.DoubleFieldScript; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.aggregations.support.ValuesSourceType; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/GeoPointScriptDocValues.java b/server/src/main/java/org/elasticsearch/index/fielddata/GeoPointScriptDocValues.java similarity index 88% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/GeoPointScriptDocValues.java rename to server/src/main/java/org/elasticsearch/index/fielddata/GeoPointScriptDocValues.java index 16b6f2f2ce40a..2b995fe9bfeac 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/GeoPointScriptDocValues.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/GeoPointScriptDocValues.java @@ -6,12 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; import org.apache.lucene.geo.GeoEncodingUtils; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.index.fielddata.MultiGeoPointValues; -import org.elasticsearch.runtimefields.mapper.GeoPointFieldScript; +import org.elasticsearch.script.GeoPointFieldScript; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/GeoPointScriptFieldData.java b/server/src/main/java/org/elasticsearch/index/fielddata/GeoPointScriptFieldData.java similarity index 89% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/GeoPointScriptFieldData.java rename to server/src/main/java/org/elasticsearch/index/fielddata/GeoPointScriptFieldData.java index 9d1fee30d0f5f..03e4ae09d4716 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/GeoPointScriptFieldData.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/GeoPointScriptFieldData.java @@ -6,19 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.search.SortField; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.index.fielddata.IndexFieldData; -import org.elasticsearch.index.fielddata.IndexFieldDataCache; -import org.elasticsearch.index.fielddata.IndexGeoPointFieldData; -import org.elasticsearch.index.fielddata.LeafGeoPointFieldData; -import org.elasticsearch.index.fielddata.MultiGeoPointValues; import org.elasticsearch.index.fielddata.plain.AbstractLeafGeoPointFieldData; import org.elasticsearch.indices.breaker.CircuitBreakerService; -import org.elasticsearch.runtimefields.mapper.GeoPointFieldScript; +import org.elasticsearch.script.GeoPointFieldScript; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.MultiValueMode; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/IpScriptDocValues.java b/server/src/main/java/org/elasticsearch/index/fielddata/IpScriptDocValues.java similarity index 86% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/IpScriptDocValues.java rename to server/src/main/java/org/elasticsearch/index/fielddata/IpScriptDocValues.java index 370ece76c484d..2fe6ed04072dd 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/IpScriptDocValues.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/IpScriptDocValues.java @@ -6,11 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.index.fielddata.SortedBinaryDocValues; -import org.elasticsearch.runtimefields.mapper.IpFieldScript; +import org.elasticsearch.script.IpFieldScript; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/IpScriptFieldData.java b/server/src/main/java/org/elasticsearch/index/fielddata/IpScriptFieldData.java similarity index 86% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/IpScriptFieldData.java rename to server/src/main/java/org/elasticsearch/index/fielddata/IpScriptFieldData.java index e41a9c4083ea7..7d343e44ffb81 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/IpScriptFieldData.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/IpScriptFieldData.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; import org.apache.lucene.document.InetAddressPoint; import org.apache.lucene.index.LeafReaderContext; @@ -14,13 +14,9 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.network.InetAddresses; -import org.elasticsearch.index.fielddata.IndexFieldData; -import org.elasticsearch.index.fielddata.IndexFieldDataCache; -import org.elasticsearch.index.fielddata.ScriptDocValues; -import org.elasticsearch.index.fielddata.SortedBinaryDocValues; import org.elasticsearch.index.mapper.IpFieldMapper; import org.elasticsearch.indices.breaker.CircuitBreakerService; -import org.elasticsearch.runtimefields.mapper.IpFieldScript; +import org.elasticsearch.script.IpFieldScript; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.aggregations.support.ValuesSourceType; @@ -60,7 +56,7 @@ public ScriptDocValues getScriptValues() { @Override public SortedBinaryDocValues getBytesValues() { - return new org.elasticsearch.runtimefields.fielddata.IpScriptDocValues(script); + return new org.elasticsearch.index.fielddata.IpScriptDocValues(script); } }; } diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/LongScriptDocValues.java b/server/src/main/java/org/elasticsearch/index/fielddata/LongScriptDocValues.java similarity index 84% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/LongScriptDocValues.java rename to server/src/main/java/org/elasticsearch/index/fielddata/LongScriptDocValues.java index 8cd20493910cf..353c131eb5cc0 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/LongScriptDocValues.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/LongScriptDocValues.java @@ -6,10 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; -import org.elasticsearch.index.fielddata.AbstractSortedNumericDocValues; -import org.elasticsearch.runtimefields.mapper.AbstractLongFieldScript; +import org.elasticsearch.script.AbstractLongFieldScript; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/LongScriptFieldData.java b/server/src/main/java/org/elasticsearch/index/fielddata/LongScriptFieldData.java similarity index 90% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/LongScriptFieldData.java rename to server/src/main/java/org/elasticsearch/index/fielddata/LongScriptFieldData.java index 53dd9932d5395..3ac5fed153f27 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/LongScriptFieldData.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/LongScriptFieldData.java @@ -6,17 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.SortedNumericDocValues; import org.elasticsearch.ExceptionsHelper; -import org.elasticsearch.index.fielddata.IndexFieldData; -import org.elasticsearch.index.fielddata.IndexFieldDataCache; -import org.elasticsearch.index.fielddata.IndexNumericFieldData; import org.elasticsearch.index.fielddata.plain.LeafLongFieldData; import org.elasticsearch.indices.breaker.CircuitBreakerService; -import org.elasticsearch.runtimefields.mapper.LongFieldScript; +import org.elasticsearch.script.LongFieldScript; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.aggregations.support.ValuesSourceType; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/StringScriptDocValues.java b/server/src/main/java/org/elasticsearch/index/fielddata/StringScriptDocValues.java similarity index 84% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/StringScriptDocValues.java rename to server/src/main/java/org/elasticsearch/index/fielddata/StringScriptDocValues.java index 1f60b4918e781..e42659743521f 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/StringScriptDocValues.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/StringScriptDocValues.java @@ -6,10 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; -import org.elasticsearch.index.fielddata.SortingBinaryDocValues; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/StringScriptFieldData.java b/server/src/main/java/org/elasticsearch/index/fielddata/StringScriptFieldData.java similarity index 85% rename from server/src/main/java/org/elasticsearch/runtimefields/fielddata/StringScriptFieldData.java rename to server/src/main/java/org/elasticsearch/index/fielddata/StringScriptFieldData.java index 3ae258164d003..dfb480e0b21e0 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/fielddata/StringScriptFieldData.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/StringScriptFieldData.java @@ -6,15 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.fielddata; +package org.elasticsearch.index.fielddata; import org.apache.lucene.index.LeafReaderContext; -import org.elasticsearch.index.fielddata.IndexFieldData; -import org.elasticsearch.index.fielddata.IndexFieldDataCache; -import org.elasticsearch.index.fielddata.ScriptDocValues; -import org.elasticsearch.index.fielddata.SortedBinaryDocValues; import org.elasticsearch.indices.breaker.CircuitBreakerService; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.aggregations.support.ValuesSourceType; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/AbstractScriptFieldType.java b/server/src/main/java/org/elasticsearch/index/mapper/AbstractScriptFieldType.java similarity index 95% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/AbstractScriptFieldType.java rename to server/src/main/java/org/elasticsearch/index/mapper/AbstractScriptFieldType.java index 0c90fbba51c65..6dcda49a43997 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/AbstractScriptFieldType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/AbstractScriptFieldType.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.search.MultiTermQuery; @@ -20,13 +20,6 @@ import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.mapper.DocValueFetcher; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.RuntimeField; -import org.elasticsearch.index.mapper.TextSearchInfo; -import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptContext; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/BooleanScriptFieldType.java b/server/src/main/java/org/elasticsearch/index/mapper/BooleanScriptFieldType.java similarity index 86% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/BooleanScriptFieldType.java rename to server/src/main/java/org/elasticsearch/index/mapper/BooleanScriptFieldType.java index 3b22894dd5738..4c8f61b2cca72 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/BooleanScriptFieldType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/BooleanScriptFieldType.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; @@ -16,12 +16,11 @@ import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.index.mapper.BooleanFieldMapper; -import org.elasticsearch.index.mapper.RuntimeField; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.BooleanScriptFieldData; -import org.elasticsearch.runtimefields.query.BooleanScriptFieldExistsQuery; -import org.elasticsearch.runtimefields.query.BooleanScriptFieldTermQuery; +import org.elasticsearch.index.fielddata.BooleanScriptFieldData; +import org.elasticsearch.script.BooleanFieldScript; +import org.elasticsearch.search.runtime.BooleanScriptFieldExistsQuery; +import org.elasticsearch.search.runtime.BooleanScriptFieldTermQuery; import org.elasticsearch.script.Script; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.lookup.SearchLookup; @@ -34,8 +33,32 @@ public final class BooleanScriptFieldType extends AbstractScriptFieldType { + private static final BooleanFieldScript.Factory PARSE_FROM_SOURCE + = (field, params, lookup) -> (BooleanFieldScript.LeafFactory) ctx -> new BooleanFieldScript + ( + field, + params, + lookup, + ctx + ) { + @Override + public void execute() { + for (Object v : extractFromSource(field)) { + if (v instanceof Boolean) { + emit((Boolean) v); + } else if (v instanceof String) { + try { + emit(Booleans.parseBoolean((String) v)); + } catch (IllegalArgumentException e) { + // ignore + } + } + } + } + }; + public static final RuntimeField.Parser PARSER = new RuntimeField.Parser(name -> - new Builder(name, BooleanFieldScript.CONTEXT, BooleanFieldScript.PARSE_FROM_SOURCE) { + new Builder(name, BooleanFieldScript.CONTEXT, PARSE_FROM_SOURCE) { @Override RuntimeField newRuntimeField(BooleanFieldScript.Factory scriptFactory) { return new BooleanScriptFieldType(name, scriptFactory, getScript(), meta(), this); @@ -43,7 +66,7 @@ RuntimeField newRuntimeField(BooleanFieldScript.Factory scriptFactory) { }); public BooleanScriptFieldType(String name) { - this(name, BooleanFieldScript.PARSE_FROM_SOURCE, null, Collections.emptyMap(), (builder, params) -> builder); + this(name, PARSE_FROM_SOURCE, null, Collections.emptyMap(), (builder, params) -> builder); } BooleanScriptFieldType( diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/DateScriptFieldType.java b/server/src/main/java/org/elasticsearch/index/mapper/DateScriptFieldType.java similarity index 87% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/DateScriptFieldType.java rename to server/src/main/java/org/elasticsearch/index/mapper/DateScriptFieldType.java index 4e2328652e388..a663bea035853 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/DateScriptFieldType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DateScriptFieldType.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import com.carrotsearch.hppc.LongHashSet; import com.carrotsearch.hppc.LongSet; @@ -18,21 +18,19 @@ import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.LocaleUtils; import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.index.mapper.DateFieldMapper; +import org.elasticsearch.index.fielddata.DateScriptFieldData; import org.elasticsearch.index.mapper.DateFieldMapper.DateFieldType; import org.elasticsearch.index.mapper.DateFieldMapper.Resolution; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.RuntimeField; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.DateScriptFieldData; -import org.elasticsearch.runtimefields.query.LongScriptFieldDistanceFeatureQuery; -import org.elasticsearch.runtimefields.query.LongScriptFieldExistsQuery; -import org.elasticsearch.runtimefields.query.LongScriptFieldRangeQuery; -import org.elasticsearch.runtimefields.query.LongScriptFieldTermQuery; -import org.elasticsearch.runtimefields.query.LongScriptFieldTermsQuery; +import org.elasticsearch.script.DateFieldScript; import org.elasticsearch.script.Script; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.lookup.SearchLookup; +import org.elasticsearch.search.runtime.LongScriptFieldDistanceFeatureQuery; +import org.elasticsearch.search.runtime.LongScriptFieldExistsQuery; +import org.elasticsearch.search.runtime.LongScriptFieldRangeQuery; +import org.elasticsearch.search.runtime.LongScriptFieldTermQuery; +import org.elasticsearch.search.runtime.LongScriptFieldTermsQuery; import java.time.ZoneId; import java.time.ZoneOffset; @@ -42,12 +40,34 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Objects; import java.util.function.Supplier; public class DateScriptFieldType extends AbstractScriptFieldType { + static final DateFieldScript.Factory PARSE_FROM_SOURCE + = (field, params, lookup, formatter) -> (DateFieldScript.LeafFactory) ctx -> new DateFieldScript + ( + field, + params, + lookup, + formatter, + ctx + ) { + @Override + public void execute() { + for (Object v : extractFromSource(field)) { + try { + emit(formatter.parseMillis(Objects.toString(v))); + } catch (Exception e) { + // ignore + } + } + } + }; + public static final RuntimeField.Parser PARSER = new RuntimeField.Parser(name -> - new Builder(name, DateFieldScript.CONTEXT, DateFieldScript.PARSE_FROM_SOURCE) { + new Builder(name, DateFieldScript.CONTEXT, PARSE_FROM_SOURCE) { private final FieldMapper.Parameter format = FieldMapper.Parameter.stringParam( "format", true, @@ -91,7 +111,7 @@ RuntimeField newRuntimeField(DateFieldScript.Factory scriptFactory) { private final DateFormatter dateTimeFormatter; public DateScriptFieldType(String name, DateFormatter dateTimeFormatter) { - this(name, DateFieldScript.PARSE_FROM_SOURCE, dateTimeFormatter, null, Collections.emptyMap(), (builder, params) -> { + this(name, PARSE_FROM_SOURCE, dateTimeFormatter, null, Collections.emptyMap(), (builder, params) -> { if (DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.pattern().equals(dateTimeFormatter.pattern()) == false) { builder.field("format", dateTimeFormatter.pattern()); } diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/DoubleScriptFieldType.java b/server/src/main/java/org/elasticsearch/index/mapper/DoubleScriptFieldType.java similarity index 76% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/DoubleScriptFieldType.java rename to server/src/main/java/org/elasticsearch/index/mapper/DoubleScriptFieldType.java index b1b2971067321..af3b48a650af3 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/DoubleScriptFieldType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DoubleScriptFieldType.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import com.carrotsearch.hppc.LongHashSet; import com.carrotsearch.hppc.LongSet; @@ -15,13 +15,13 @@ import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.index.mapper.NumberFieldMapper.NumberType; -import org.elasticsearch.index.mapper.RuntimeField; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.DoubleScriptFieldData; -import org.elasticsearch.runtimefields.query.DoubleScriptFieldExistsQuery; -import org.elasticsearch.runtimefields.query.DoubleScriptFieldRangeQuery; -import org.elasticsearch.runtimefields.query.DoubleScriptFieldTermQuery; -import org.elasticsearch.runtimefields.query.DoubleScriptFieldTermsQuery; +import org.elasticsearch.index.fielddata.DoubleScriptFieldData; +import org.elasticsearch.script.DoubleFieldScript; +import org.elasticsearch.search.runtime.DoubleScriptFieldExistsQuery; +import org.elasticsearch.search.runtime.DoubleScriptFieldRangeQuery; +import org.elasticsearch.search.runtime.DoubleScriptFieldTermQuery; +import org.elasticsearch.search.runtime.DoubleScriptFieldTermsQuery; import org.elasticsearch.script.Script; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.lookup.SearchLookup; @@ -34,8 +34,32 @@ public final class DoubleScriptFieldType extends AbstractScriptFieldType { + private static final DoubleFieldScript.Factory PARSE_FROM_SOURCE + = (field, params, lookup) -> (DoubleFieldScript.LeafFactory) ctx -> new DoubleFieldScript + ( + field, + params, + lookup, + ctx + ) { + @Override + public void execute() { + for (Object v : extractFromSource(field)) { + if (v instanceof Number) { + emit(((Number) v).doubleValue()); + } else if (v instanceof String) { + try { + emit(Double.parseDouble((String) v)); + } catch (NumberFormatException e) { + // ignore + } + } + } + } + }; + public static final RuntimeField.Parser PARSER = new RuntimeField.Parser(name -> - new Builder(name, DoubleFieldScript.CONTEXT, DoubleFieldScript.PARSE_FROM_SOURCE) { + new Builder(name, DoubleFieldScript.CONTEXT, PARSE_FROM_SOURCE) { @Override RuntimeField newRuntimeField(DoubleFieldScript.Factory scriptFactory) { return new DoubleScriptFieldType(name, scriptFactory, getScript(), meta(), this); @@ -43,7 +67,7 @@ RuntimeField newRuntimeField(DoubleFieldScript.Factory scriptFactory) { }); public DoubleScriptFieldType(String name) { - this(name, DoubleFieldScript.PARSE_FROM_SOURCE, null, Collections.emptyMap(), (builder, params) -> builder); + this(name, PARSE_FROM_SOURCE, null, Collections.emptyMap(), (builder, params) -> builder); } DoubleScriptFieldType( diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DynamicFieldsBuilder.java b/server/src/main/java/org/elasticsearch/index/mapper/DynamicFieldsBuilder.java index 9efbc1f8fdc1c..2419219ed70dc 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DynamicFieldsBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DynamicFieldsBuilder.java @@ -15,11 +15,6 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.ObjectMapper.Dynamic; -import org.elasticsearch.runtimefields.mapper.BooleanScriptFieldType; -import org.elasticsearch.runtimefields.mapper.DateScriptFieldType; -import org.elasticsearch.runtimefields.mapper.DoubleScriptFieldType; -import org.elasticsearch.runtimefields.mapper.KeywordScriptFieldType; -import org.elasticsearch.runtimefields.mapper.LongScriptFieldType; import java.io.IOException; import java.time.format.DateTimeParseException; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/GeoPointScriptFieldType.java b/server/src/main/java/org/elasticsearch/index/mapper/GeoPointScriptFieldType.java similarity index 72% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/GeoPointScriptFieldType.java rename to server/src/main/java/org/elasticsearch/index/mapper/GeoPointScriptFieldType.java index e4b6524e140a3..7e019ae0ef5d9 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/GeoPointScriptFieldType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/GeoPointScriptFieldType.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.geo.LatLonGeometry; import org.apache.lucene.geo.Point; @@ -19,27 +19,66 @@ import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.geometry.Geometry; -import org.elasticsearch.index.mapper.GeoPointFieldMapper; -import org.elasticsearch.index.mapper.GeoShapeQueryable; -import org.elasticsearch.index.mapper.RuntimeField; +import org.elasticsearch.index.fielddata.GeoPointScriptFieldData; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.GeoPointScriptFieldData; -import org.elasticsearch.runtimefields.query.GeoPointScriptFieldDistanceFeatureQuery; -import org.elasticsearch.runtimefields.query.GeoPointScriptFieldExistsQuery; -import org.elasticsearch.runtimefields.query.GeoPointScriptFieldGeoShapeQuery; +import org.elasticsearch.script.GeoPointFieldScript; import org.elasticsearch.script.Script; import org.elasticsearch.search.lookup.SearchLookup; +import org.elasticsearch.search.runtime.GeoPointScriptFieldDistanceFeatureQuery; +import org.elasticsearch.search.runtime.GeoPointScriptFieldExistsQuery; +import org.elasticsearch.search.runtime.GeoPointScriptFieldGeoShapeQuery; import java.time.ZoneId; import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.function.Supplier; public final class GeoPointScriptFieldType extends AbstractScriptFieldType implements GeoShapeQueryable { + private static final GeoPointFieldScript.Factory PARSE_FROM_SOURCE + = (field, params, lookup) -> (GeoPointFieldScript.LeafFactory) ctx -> new GeoPointFieldScript + ( + field, + params, + lookup, + ctx + ) { + private final GeoPoint scratch = new GeoPoint(); + + @Override + public void execute() { + try { + Object value = XContentMapValues.extractValue(field, leafSearchLookup.source().source()); + if (value instanceof List) { + List values = (List) value; + if (values.size() > 0 && values.get(0) instanceof Number) { + parsePoint(value); + } else { + for (Object point : values) { + parsePoint(point); + } + } + } else { + parsePoint(value); + } + } catch (Exception e) { + // ignore + } + } + + private void parsePoint(Object point) { + if (point != null) { + GeoUtils.parseGeoPoint(point, scratch, true); + emit(scratch.lat(), scratch.lon()); + } + } + }; + public static final RuntimeField.Parser PARSER = new RuntimeField.Parser(name -> - new Builder(name, GeoPointFieldScript.CONTEXT, GeoPointFieldScript.PARSE_FROM_SOURCE) { + new Builder(name, GeoPointFieldScript.CONTEXT, PARSE_FROM_SOURCE) { @Override RuntimeField newRuntimeField(GeoPointFieldScript.Factory scriptFactory) { return new GeoPointScriptFieldType(name, scriptFactory, getScript(), meta(), this); diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/IpScriptFieldType.java b/server/src/main/java/org/elasticsearch/index/mapper/IpScriptFieldType.java similarity index 87% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/IpScriptFieldType.java rename to server/src/main/java/org/elasticsearch/index/mapper/IpScriptFieldType.java index 6bd289a1187bd..56f62149b6d87 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/IpScriptFieldType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/IpScriptFieldType.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.InetAddressPoint; import org.apache.lucene.search.BooleanClause.Occur; @@ -20,14 +20,13 @@ import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.BytesRefHash; import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.index.mapper.IpFieldMapper; -import org.elasticsearch.index.mapper.RuntimeField; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.IpScriptFieldData; -import org.elasticsearch.runtimefields.query.IpScriptFieldExistsQuery; -import org.elasticsearch.runtimefields.query.IpScriptFieldRangeQuery; -import org.elasticsearch.runtimefields.query.IpScriptFieldTermQuery; -import org.elasticsearch.runtimefields.query.IpScriptFieldTermsQuery; +import org.elasticsearch.index.fielddata.IpScriptFieldData; +import org.elasticsearch.script.IpFieldScript; +import org.elasticsearch.search.runtime.IpScriptFieldExistsQuery; +import org.elasticsearch.search.runtime.IpScriptFieldRangeQuery; +import org.elasticsearch.search.runtime.IpScriptFieldTermQuery; +import org.elasticsearch.search.runtime.IpScriptFieldTermsQuery; import org.elasticsearch.script.Script; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.lookup.SearchLookup; @@ -43,8 +42,30 @@ public final class IpScriptFieldType extends AbstractScriptFieldType { + private static final IpFieldScript.Factory PARSE_FROM_SOURCE + = (field, params, lookup) -> (IpFieldScript.LeafFactory) ctx -> new IpFieldScript + ( + field, + params, + lookup, + ctx + ) { + @Override + public void execute() { + for (Object v : extractFromSource(field)) { + if (v instanceof String) { + try { + emit((String) v); + } catch (Exception e) { + // ignore parsing exceptions + } + } + } + } + }; + public static final RuntimeField.Parser PARSER = new RuntimeField.Parser(name -> - new Builder(name, IpFieldScript.CONTEXT, IpFieldScript.PARSE_FROM_SOURCE) { + new Builder(name, IpFieldScript.CONTEXT, PARSE_FROM_SOURCE) { @Override RuntimeField newRuntimeField(IpFieldScript.Factory scriptFactory) { return new IpScriptFieldType(name, scriptFactory, getScript(), meta(), this); diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/KeywordScriptFieldType.java b/server/src/main/java/org/elasticsearch/index/mapper/KeywordScriptFieldType.java similarity index 82% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/KeywordScriptFieldType.java rename to server/src/main/java/org/elasticsearch/index/mapper/KeywordScriptFieldType.java index 842d9d1870a00..588ef507cd967 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/KeywordScriptFieldType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/KeywordScriptFieldType.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.search.MultiTermQuery.RewriteMethod; import org.apache.lucene.search.Query; @@ -15,18 +15,17 @@ import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.index.mapper.KeywordFieldMapper; -import org.elasticsearch.index.mapper.RuntimeField; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.StringScriptFieldData; -import org.elasticsearch.runtimefields.query.StringScriptFieldExistsQuery; -import org.elasticsearch.runtimefields.query.StringScriptFieldFuzzyQuery; -import org.elasticsearch.runtimefields.query.StringScriptFieldPrefixQuery; -import org.elasticsearch.runtimefields.query.StringScriptFieldRangeQuery; -import org.elasticsearch.runtimefields.query.StringScriptFieldRegexpQuery; -import org.elasticsearch.runtimefields.query.StringScriptFieldTermQuery; -import org.elasticsearch.runtimefields.query.StringScriptFieldTermsQuery; -import org.elasticsearch.runtimefields.query.StringScriptFieldWildcardQuery; +import org.elasticsearch.index.fielddata.StringScriptFieldData; +import org.elasticsearch.script.StringFieldScript; +import org.elasticsearch.search.runtime.StringScriptFieldExistsQuery; +import org.elasticsearch.search.runtime.StringScriptFieldFuzzyQuery; +import org.elasticsearch.search.runtime.StringScriptFieldPrefixQuery; +import org.elasticsearch.search.runtime.StringScriptFieldRangeQuery; +import org.elasticsearch.search.runtime.StringScriptFieldRegexpQuery; +import org.elasticsearch.search.runtime.StringScriptFieldTermQuery; +import org.elasticsearch.search.runtime.StringScriptFieldTermsQuery; +import org.elasticsearch.search.runtime.StringScriptFieldWildcardQuery; import org.elasticsearch.script.Script; import org.elasticsearch.search.lookup.SearchLookup; @@ -42,8 +41,26 @@ public final class KeywordScriptFieldType extends AbstractScriptFieldType { + private static final StringFieldScript.Factory PARSE_FROM_SOURCE + = (field, params, lookup) -> (StringFieldScript.LeafFactory) ctx -> new StringFieldScript + ( + field, + params, + lookup, + ctx + ) { + @Override + public void execute() { + for (Object v : extractFromSource(field)) { + if (v != null) { + emit(v.toString()); + } + } + } + }; + public static final RuntimeField.Parser PARSER = new RuntimeField.Parser(name -> - new Builder(name, StringFieldScript.CONTEXT, StringFieldScript.PARSE_FROM_SOURCE) { + new Builder(name, StringFieldScript.CONTEXT, PARSE_FROM_SOURCE) { @Override RuntimeField newRuntimeField(StringFieldScript.Factory scriptFactory) { return new KeywordScriptFieldType(name, scriptFactory, getScript(), meta(), this); @@ -51,7 +68,7 @@ RuntimeField newRuntimeField(StringFieldScript.Factory scriptFactory) { }); public KeywordScriptFieldType(String name) { - this(name, StringFieldScript.PARSE_FROM_SOURCE, null, Collections.emptyMap(), (builder, params) -> builder); + this(name, PARSE_FROM_SOURCE, null, Collections.emptyMap(), (builder, params) -> builder); } KeywordScriptFieldType( diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/LongScriptFieldType.java b/server/src/main/java/org/elasticsearch/index/mapper/LongScriptFieldType.java similarity index 80% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/LongScriptFieldType.java rename to server/src/main/java/org/elasticsearch/index/mapper/LongScriptFieldType.java index cd70a3b9f9233..7b148832282e0 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/LongScriptFieldType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/LongScriptFieldType.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import com.carrotsearch.hppc.LongHashSet; import com.carrotsearch.hppc.LongSet; @@ -15,13 +15,13 @@ import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.index.mapper.NumberFieldMapper.NumberType; -import org.elasticsearch.index.mapper.RuntimeField; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.LongScriptFieldData; -import org.elasticsearch.runtimefields.query.LongScriptFieldExistsQuery; -import org.elasticsearch.runtimefields.query.LongScriptFieldRangeQuery; -import org.elasticsearch.runtimefields.query.LongScriptFieldTermQuery; -import org.elasticsearch.runtimefields.query.LongScriptFieldTermsQuery; +import org.elasticsearch.index.fielddata.LongScriptFieldData; +import org.elasticsearch.script.LongFieldScript; +import org.elasticsearch.search.runtime.LongScriptFieldExistsQuery; +import org.elasticsearch.search.runtime.LongScriptFieldRangeQuery; +import org.elasticsearch.search.runtime.LongScriptFieldTermQuery; +import org.elasticsearch.search.runtime.LongScriptFieldTermsQuery; import org.elasticsearch.script.Script; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.lookup.SearchLookup; @@ -34,8 +34,28 @@ public final class LongScriptFieldType extends AbstractScriptFieldType { + private static final LongFieldScript.Factory PARSE_FROM_SOURCE + = (field, params, lookup) -> (LongFieldScript.LeafFactory) ctx -> new LongFieldScript + ( + field, + params, + lookup, + ctx + ) { + @Override + public void execute() { + for (Object v : extractFromSource(field)) { + try { + emit(NumberFieldMapper.NumberType.objectToLong(v, true)); + } catch (Exception e) { + // ignore; + } + } + } + }; + public static final RuntimeField.Parser PARSER = new RuntimeField.Parser(name -> - new Builder(name, LongFieldScript.CONTEXT, LongFieldScript.PARSE_FROM_SOURCE) { + new Builder(name, LongFieldScript.CONTEXT, PARSE_FROM_SOURCE) { @Override RuntimeField newRuntimeField(LongFieldScript.Factory scriptFactory) { return new LongScriptFieldType(name, scriptFactory, getScript(), meta(), this); @@ -43,7 +63,7 @@ RuntimeField newRuntimeField(LongFieldScript.Factory scriptFactory) { }); public LongScriptFieldType(String name) { - this(name, LongFieldScript.PARSE_FROM_SOURCE, null, Collections.emptyMap(), (builder, params) -> builder); + this(name, PARSE_FROM_SOURCE, null, Collections.emptyMap(), (builder, params) -> builder); } LongScriptFieldType( diff --git a/server/src/main/java/org/elasticsearch/indices/IndicesModule.java b/server/src/main/java/org/elasticsearch/indices/IndicesModule.java index 6f836cc9531d1..2e5d2efa4c54b 100644 --- a/server/src/main/java/org/elasticsearch/indices/IndicesModule.java +++ b/server/src/main/java/org/elasticsearch/indices/IndicesModule.java @@ -56,13 +56,13 @@ import org.elasticsearch.indices.store.IndicesStore; import org.elasticsearch.indices.store.TransportNodesListShardStoreMetadata; import org.elasticsearch.plugins.MapperPlugin; -import org.elasticsearch.runtimefields.mapper.BooleanScriptFieldType; -import org.elasticsearch.runtimefields.mapper.DateScriptFieldType; -import org.elasticsearch.runtimefields.mapper.DoubleScriptFieldType; -import org.elasticsearch.runtimefields.mapper.GeoPointScriptFieldType; -import org.elasticsearch.runtimefields.mapper.IpScriptFieldType; -import org.elasticsearch.runtimefields.mapper.KeywordScriptFieldType; -import org.elasticsearch.runtimefields.mapper.LongScriptFieldType; +import org.elasticsearch.index.mapper.BooleanScriptFieldType; +import org.elasticsearch.index.mapper.DateScriptFieldType; +import org.elasticsearch.index.mapper.DoubleScriptFieldType; +import org.elasticsearch.index.mapper.GeoPointScriptFieldType; +import org.elasticsearch.index.mapper.IpScriptFieldType; +import org.elasticsearch.index.mapper.KeywordScriptFieldType; +import org.elasticsearch.index.mapper.LongScriptFieldType; import java.util.ArrayList; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/AbstractFieldScript.java b/server/src/main/java/org/elasticsearch/script/AbstractFieldScript.java similarity index 94% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/AbstractFieldScript.java rename to server/src/main/java/org/elasticsearch/script/AbstractFieldScript.java index aa770508da347..6f7065d4d35b0 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/AbstractFieldScript.java +++ b/server/src/main/java/org/elasticsearch/script/AbstractFieldScript.java @@ -6,15 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.script; import org.apache.lucene.index.LeafReaderContext; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.fielddata.ScriptDocValues; -import org.elasticsearch.script.AggregationScript; -import org.elasticsearch.script.DynamicMap; -import org.elasticsearch.script.ScriptCache; -import org.elasticsearch.script.ScriptContext; import org.elasticsearch.search.lookup.LeafSearchLookup; import org.elasticsearch.search.lookup.SearchLookup; import org.elasticsearch.search.lookup.SourceLookup; @@ -35,7 +31,7 @@ public abstract class AbstractFieldScript { /** * The maximum number of values a script should be allowed to emit. */ - static final int MAX_VALUES = 100; + public static final int MAX_VALUES = 100; static ScriptContext newContext(String name, Class factoryClass) { return new ScriptContext<>( diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/AbstractLongFieldScript.java b/server/src/main/java/org/elasticsearch/script/AbstractLongFieldScript.java similarity index 97% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/AbstractLongFieldScript.java rename to server/src/main/java/org/elasticsearch/script/AbstractLongFieldScript.java index ab4e30ea9914f..affc1b4ed19ca 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/AbstractLongFieldScript.java +++ b/server/src/main/java/org/elasticsearch/script/AbstractLongFieldScript.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.script; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.util.ArrayUtil; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/BooleanFieldScript.java b/server/src/main/java/org/elasticsearch/script/BooleanFieldScript.java similarity index 71% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/BooleanFieldScript.java rename to server/src/main/java/org/elasticsearch/script/BooleanFieldScript.java index 6e735a64646c1..e15cb6d6208a2 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/BooleanFieldScript.java +++ b/server/src/main/java/org/elasticsearch/script/BooleanFieldScript.java @@ -6,12 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.script; import org.apache.lucene.index.LeafReaderContext; -import org.elasticsearch.common.Booleans; -import org.elasticsearch.script.ScriptContext; -import org.elasticsearch.script.ScriptFactory; import org.elasticsearch.search.lookup.SearchLookup; import java.util.Map; @@ -31,28 +28,6 @@ public interface LeafFactory { BooleanFieldScript newInstance(LeafReaderContext ctx); } - static final Factory PARSE_FROM_SOURCE = (field, params, lookup) -> (LeafFactory) ctx -> new BooleanFieldScript( - field, - params, - lookup, - ctx - ) { - @Override - public void execute() { - for (Object v : extractFromSource(field)) { - if (v instanceof Boolean) { - emit((Boolean) v); - } else if (v instanceof String) { - try { - emit(Booleans.parseBoolean((String) v)); - } catch (IllegalArgumentException e) { - // ignore - } - } - } - } - }; - private int trues; private int falses; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/DateFieldScript.java b/server/src/main/java/org/elasticsearch/script/DateFieldScript.java similarity index 75% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/DateFieldScript.java rename to server/src/main/java/org/elasticsearch/script/DateFieldScript.java index 75a8a0aee7c94..2dd6c4dfc9466 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/DateFieldScript.java +++ b/server/src/main/java/org/elasticsearch/script/DateFieldScript.java @@ -6,16 +6,13 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.script; import org.apache.lucene.index.LeafReaderContext; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.script.ScriptContext; -import org.elasticsearch.script.ScriptFactory; import org.elasticsearch.search.lookup.SearchLookup; import java.util.Map; -import java.util.Objects; public abstract class DateFieldScript extends AbstractLongFieldScript { public static final ScriptContext CONTEXT = newContext("date", Factory.class); @@ -31,25 +28,6 @@ public interface LeafFactory { DateFieldScript newInstance(LeafReaderContext ctx); } - static final Factory PARSE_FROM_SOURCE = (field, params, lookup, formatter) -> (LeafFactory) ctx -> new DateFieldScript( - field, - params, - lookup, - formatter, - ctx - ) { - @Override - public void execute() { - for (Object v : extractFromSource(field)) { - try { - emit(formatter.parseMillis(Objects.toString(v))); - } catch (Exception e) { - // ignore - } - } - } - }; - private final DateFormatter formatter; public DateFieldScript( diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/DoubleFieldScript.java b/server/src/main/java/org/elasticsearch/script/DoubleFieldScript.java similarity index 75% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/DoubleFieldScript.java rename to server/src/main/java/org/elasticsearch/script/DoubleFieldScript.java index 561ec78ceebf6..0d6f289ce98b0 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/DoubleFieldScript.java +++ b/server/src/main/java/org/elasticsearch/script/DoubleFieldScript.java @@ -6,12 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.script; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.util.ArrayUtil; -import org.elasticsearch.script.ScriptContext; -import org.elasticsearch.script.ScriptFactory; import org.elasticsearch.search.lookup.SearchLookup; import java.util.Map; @@ -30,27 +28,7 @@ public interface LeafFactory { DoubleFieldScript newInstance(LeafReaderContext ctx); } - static final Factory PARSE_FROM_SOURCE = (field, params, lookup) -> (LeafFactory) ctx -> new DoubleFieldScript( - field, - params, - lookup, - ctx - ) { - @Override - public void execute() { - for (Object v : extractFromSource(field)) { - if (v instanceof Number) { - emit(((Number) v).doubleValue()); - } else if (v instanceof String) { - try { - emit(Double.parseDouble((String) v)); - } catch (NumberFormatException e) { - // ignore - } - } - } - } - }; + private double[] values = new double[1]; private int count; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/GeoPointFieldScript.java b/server/src/main/java/org/elasticsearch/script/GeoPointFieldScript.java similarity index 57% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/GeoPointFieldScript.java rename to server/src/main/java/org/elasticsearch/script/GeoPointFieldScript.java index 024d19e874c78..f6c0b52f436f5 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/GeoPointFieldScript.java +++ b/server/src/main/java/org/elasticsearch/script/GeoPointFieldScript.java @@ -6,18 +6,12 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.script; import org.apache.lucene.document.LatLonDocValuesField; import org.apache.lucene.index.LeafReaderContext; -import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.geo.GeoUtils; -import org.elasticsearch.common.xcontent.support.XContentMapValues; -import org.elasticsearch.script.ScriptContext; -import org.elasticsearch.script.ScriptFactory; import org.elasticsearch.search.lookup.SearchLookup; -import java.util.List; import java.util.Map; import static org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude; @@ -41,43 +35,6 @@ public interface LeafFactory { GeoPointFieldScript newInstance(LeafReaderContext ctx); } - static final Factory PARSE_FROM_SOURCE = (field, params, lookup) -> (LeafFactory) ctx -> new GeoPointFieldScript( - field, - params, - lookup, - ctx - ) { - private final GeoPoint scratch = new GeoPoint(); - - @Override - public void execute() { - try { - Object value = XContentMapValues.extractValue(field, leafSearchLookup.source().source()); - if (value instanceof List) { - List values = (List) value; - if (values.size() > 0 && values.get(0) instanceof Number) { - parsePoint(value); - } else { - for (Object point : values) { - parsePoint(point); - } - } - } else { - parsePoint(value); - } - } catch (Exception e) { - // ignore - } - } - - private void parsePoint(Object point) { - if (point != null) { - GeoUtils.parseGeoPoint(point, scratch, true); - emit(scratch.lat(), scratch.lon()); - } - } - }; - public GeoPointFieldScript(String fieldName, Map params, SearchLookup searchLookup, LeafReaderContext ctx) { super(fieldName, params, searchLookup, ctx); } diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/IpFieldScript.java b/server/src/main/java/org/elasticsearch/script/IpFieldScript.java similarity index 85% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/IpFieldScript.java rename to server/src/main/java/org/elasticsearch/script/IpFieldScript.java index fc478fe13405a..7ac038390903d 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/IpFieldScript.java +++ b/server/src/main/java/org/elasticsearch/script/IpFieldScript.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.script; import org.apache.lucene.document.InetAddressPoint; import org.apache.lucene.index.LeafReaderContext; @@ -14,8 +14,6 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.network.InetAddresses; import org.elasticsearch.index.mapper.IpFieldMapper; -import org.elasticsearch.script.ScriptContext; -import org.elasticsearch.script.ScriptFactory; import org.elasticsearch.search.lookup.SearchLookup; import java.net.Inet4Address; @@ -51,26 +49,6 @@ public interface LeafFactory { IpFieldScript newInstance(LeafReaderContext ctx); } - static final Factory PARSE_FROM_SOURCE = (field, params, lookup) -> (LeafFactory) ctx -> new IpFieldScript( - field, - params, - lookup, - ctx - ) { - @Override - public void execute() { - for (Object v : extractFromSource(field)) { - if (v instanceof String) { - try { - emit((String) v); - } catch (Exception e) { - // ignore parsing exceptions - } - } - } - } - }; - private BytesRef[] values = new BytesRef[1]; private int count; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/LongFieldScript.java b/server/src/main/java/org/elasticsearch/script/LongFieldScript.java similarity index 67% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/LongFieldScript.java rename to server/src/main/java/org/elasticsearch/script/LongFieldScript.java index 7cf7201b3a027..fcb78c029db93 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/LongFieldScript.java +++ b/server/src/main/java/org/elasticsearch/script/LongFieldScript.java @@ -6,12 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.script; import org.apache.lucene.index.LeafReaderContext; -import org.elasticsearch.index.mapper.NumberFieldMapper; -import org.elasticsearch.script.ScriptContext; -import org.elasticsearch.script.ScriptFactory; import org.elasticsearch.search.lookup.SearchLookup; import java.util.Map; @@ -30,24 +27,6 @@ public interface LeafFactory { LongFieldScript newInstance(LeafReaderContext ctx); } - static final Factory PARSE_FROM_SOURCE = (field, params, lookup) -> (LeafFactory) ctx -> new LongFieldScript( - field, - params, - lookup, - ctx - ) { - @Override - public void execute() { - for (Object v : extractFromSource(field)) { - try { - emit(NumberFieldMapper.NumberType.objectToLong(v, true)); - } catch (Exception e) { - // ignore; - } - } - } - }; - public LongFieldScript(String fieldName, Map params, SearchLookup searchLookup, LeafReaderContext ctx) { super(fieldName, params, searchLookup, ctx); } diff --git a/server/src/main/java/org/elasticsearch/script/ScriptModule.java b/server/src/main/java/org/elasticsearch/script/ScriptModule.java index 1c1094123470f..293503e203305 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptModule.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptModule.java @@ -12,13 +12,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.query.IntervalFilterScript; import org.elasticsearch.plugins.ScriptPlugin; -import org.elasticsearch.runtimefields.mapper.BooleanFieldScript; -import org.elasticsearch.runtimefields.mapper.DateFieldScript; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; -import org.elasticsearch.runtimefields.mapper.GeoPointFieldScript; -import org.elasticsearch.runtimefields.mapper.IpFieldScript; -import org.elasticsearch.runtimefields.mapper.LongFieldScript; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; import org.elasticsearch.search.aggregations.pipeline.MovingFunctionScript; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/mapper/StringFieldScript.java b/server/src/main/java/org/elasticsearch/script/StringFieldScript.java similarity index 83% rename from server/src/main/java/org/elasticsearch/runtimefields/mapper/StringFieldScript.java rename to server/src/main/java/org/elasticsearch/script/StringFieldScript.java index de07153a3d826..a053a5185a735 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/mapper/StringFieldScript.java +++ b/server/src/main/java/org/elasticsearch/script/StringFieldScript.java @@ -6,11 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.script; import org.apache.lucene.index.LeafReaderContext; -import org.elasticsearch.script.ScriptContext; -import org.elasticsearch.script.ScriptFactory; import org.elasticsearch.search.lookup.SearchLookup; import java.util.ArrayList; @@ -37,22 +35,6 @@ public interface LeafFactory { StringFieldScript newInstance(LeafReaderContext ctx); } - static final Factory PARSE_FROM_SOURCE = (field, params, lookup) -> (LeafFactory) ctx -> new StringFieldScript( - field, - params, - lookup, - ctx - ) { - @Override - public void execute() { - for (Object v : extractFromSource(field)) { - if (v != null) { - emit(v.toString()); - } - } - } - }; - private final List results = new ArrayList<>(); private long chars; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractBooleanScriptFieldQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/AbstractBooleanScriptFieldQuery.java similarity index 89% rename from server/src/main/java/org/elasticsearch/runtimefields/query/AbstractBooleanScriptFieldQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/AbstractBooleanScriptFieldQuery.java index 5dee60be29a53..38363ee3e3fdd 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractBooleanScriptFieldQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/AbstractBooleanScriptFieldQuery.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.search.QueryVisitor; -import org.elasticsearch.runtimefields.mapper.BooleanFieldScript; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; +import org.elasticsearch.script.BooleanFieldScript; +import org.elasticsearch.script.DoubleFieldScript; import org.elasticsearch.script.Script; /** diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractDoubleScriptFieldQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/AbstractDoubleScriptFieldQuery.java similarity index 92% rename from server/src/main/java/org/elasticsearch/runtimefields/query/AbstractDoubleScriptFieldQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/AbstractDoubleScriptFieldQuery.java index f5c85a2b51e30..500d00628bd19 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractDoubleScriptFieldQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/AbstractDoubleScriptFieldQuery.java @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.search.QueryVisitor; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; +import org.elasticsearch.script.DoubleFieldScript; import org.elasticsearch.script.Script; /** diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractGeoPointScriptFieldQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/AbstractGeoPointScriptFieldQuery.java similarity index 90% rename from server/src/main/java/org/elasticsearch/runtimefields/query/AbstractGeoPointScriptFieldQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/AbstractGeoPointScriptFieldQuery.java index ec14317b79c4a..d2fb993ec93e8 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractGeoPointScriptFieldQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/AbstractGeoPointScriptFieldQuery.java @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; -import org.elasticsearch.runtimefields.mapper.GeoPointFieldScript; +import org.elasticsearch.script.GeoPointFieldScript; import org.elasticsearch.script.Script; /** diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractIpScriptFieldQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/AbstractIpScriptFieldQuery.java similarity index 89% rename from server/src/main/java/org/elasticsearch/runtimefields/query/AbstractIpScriptFieldQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/AbstractIpScriptFieldQuery.java index d9305964a592f..2deb681f98818 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractIpScriptFieldQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/AbstractIpScriptFieldQuery.java @@ -6,14 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.document.InetAddressPoint; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.runtimefields.mapper.IpFieldScript; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.IpFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.Script; import java.net.InetAddress; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractLongScriptFieldQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/AbstractLongScriptFieldQuery.java similarity index 93% rename from server/src/main/java/org/elasticsearch/runtimefields/query/AbstractLongScriptFieldQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/AbstractLongScriptFieldQuery.java index cd77d06b50249..ab4c3638ebbf3 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractLongScriptFieldQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/AbstractLongScriptFieldQuery.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.search.QueryVisitor; -import org.elasticsearch.runtimefields.mapper.AbstractLongFieldScript; +import org.elasticsearch.script.AbstractLongFieldScript; import org.elasticsearch.script.Script; import java.util.function.Function; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractScriptFieldQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/AbstractScriptFieldQuery.java similarity index 97% rename from server/src/main/java/org/elasticsearch/runtimefields/query/AbstractScriptFieldQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/AbstractScriptFieldQuery.java index af4fd81f0dd97..9acf2b6c9cc83 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractScriptFieldQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/AbstractScriptFieldQuery.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.search.ConstantScoreScorer; @@ -19,7 +19,7 @@ import org.apache.lucene.search.Scorer; import org.apache.lucene.search.TwoPhaseIterator; import org.apache.lucene.search.Weight; -import org.elasticsearch.runtimefields.mapper.AbstractFieldScript; +import org.elasticsearch.script.AbstractFieldScript; import org.elasticsearch.script.Script; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractStringScriptFieldAutomatonQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/AbstractStringScriptFieldAutomatonQuery.java similarity index 93% rename from server/src/main/java/org/elasticsearch/runtimefields/query/AbstractStringScriptFieldAutomatonQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/AbstractStringScriptFieldAutomatonQuery.java index 6720f139ad07d..38a07e24ad112 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractStringScriptFieldAutomatonQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/AbstractStringScriptFieldAutomatonQuery.java @@ -6,12 +6,12 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.search.QueryVisitor; import org.apache.lucene.util.BytesRefBuilder; import org.apache.lucene.util.automaton.ByteRunAutomaton; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.Script; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractStringScriptFieldQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/AbstractStringScriptFieldQuery.java similarity index 90% rename from server/src/main/java/org/elasticsearch/runtimefields/query/AbstractStringScriptFieldQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/AbstractStringScriptFieldQuery.java index 0512823210c49..f4517d2c0be2d 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/AbstractStringScriptFieldQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/AbstractStringScriptFieldQuery.java @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.Script; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/BooleanScriptFieldExistsQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/BooleanScriptFieldExistsQuery.java similarity index 90% rename from server/src/main/java/org/elasticsearch/runtimefields/query/BooleanScriptFieldExistsQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/BooleanScriptFieldExistsQuery.java index 80c200ae34e53..18ceeadbbc6d0 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/BooleanScriptFieldExistsQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/BooleanScriptFieldExistsQuery.java @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; -import org.elasticsearch.runtimefields.mapper.BooleanFieldScript; +import org.elasticsearch.script.BooleanFieldScript; import org.elasticsearch.script.Script; public class BooleanScriptFieldExistsQuery extends AbstractBooleanScriptFieldQuery { diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/BooleanScriptFieldTermQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/BooleanScriptFieldTermQuery.java similarity index 93% rename from server/src/main/java/org/elasticsearch/runtimefields/query/BooleanScriptFieldTermQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/BooleanScriptFieldTermQuery.java index cba184678f855..70695680b2c39 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/BooleanScriptFieldTermQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/BooleanScriptFieldTermQuery.java @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; -import org.elasticsearch.runtimefields.mapper.BooleanFieldScript; +import org.elasticsearch.script.BooleanFieldScript; import org.elasticsearch.script.Script; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldExistsQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/DoubleScriptFieldExistsQuery.java similarity index 90% rename from server/src/main/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldExistsQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/DoubleScriptFieldExistsQuery.java index c4b80a26640c2..77d5e61c47c6d 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldExistsQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/DoubleScriptFieldExistsQuery.java @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; +import org.elasticsearch.script.DoubleFieldScript; import org.elasticsearch.script.Script; public class DoubleScriptFieldExistsQuery extends AbstractDoubleScriptFieldQuery { diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldRangeQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/DoubleScriptFieldRangeQuery.java similarity index 94% rename from server/src/main/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldRangeQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/DoubleScriptFieldRangeQuery.java index 0c3e3b653a0a6..55dddf0433bdd 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldRangeQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/DoubleScriptFieldRangeQuery.java @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; +import org.elasticsearch.script.DoubleFieldScript; import org.elasticsearch.script.Script; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldTermQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/DoubleScriptFieldTermQuery.java similarity index 93% rename from server/src/main/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldTermQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/DoubleScriptFieldTermQuery.java index a685768457244..0267442c46bb4 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldTermQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/DoubleScriptFieldTermQuery.java @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; +import org.elasticsearch.script.DoubleFieldScript; import org.elasticsearch.script.Script; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldTermsQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/DoubleScriptFieldTermsQuery.java similarity index 95% rename from server/src/main/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldTermsQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/DoubleScriptFieldTermsQuery.java index 8c669c92dfa41..83324e5015cbd 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldTermsQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/DoubleScriptFieldTermsQuery.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import com.carrotsearch.hppc.LongSet; import com.carrotsearch.hppc.cursors.LongCursor; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; +import org.elasticsearch.script.DoubleFieldScript; import org.elasticsearch.script.Script; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldDistanceFeatureQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/GeoPointScriptFieldDistanceFeatureQuery.java similarity index 98% rename from server/src/main/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldDistanceFeatureQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/GeoPointScriptFieldDistanceFeatureQuery.java index 9d4b20c7af5e4..9d8fd3768ba53 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldDistanceFeatureQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/GeoPointScriptFieldDistanceFeatureQuery.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.geo.GeoEncodingUtils; import org.apache.lucene.geo.GeoUtils; @@ -21,7 +21,7 @@ import org.apache.lucene.search.TwoPhaseIterator; import org.apache.lucene.search.Weight; import org.apache.lucene.util.SloppyMath; -import org.elasticsearch.runtimefields.mapper.AbstractLongFieldScript; +import org.elasticsearch.script.AbstractLongFieldScript; import org.elasticsearch.script.Script; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldExistsQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/GeoPointScriptFieldExistsQuery.java similarity index 90% rename from server/src/main/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldExistsQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/GeoPointScriptFieldExistsQuery.java index 0947d7cc53a51..02497ede6c836 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldExistsQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/GeoPointScriptFieldExistsQuery.java @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; -import org.elasticsearch.runtimefields.mapper.GeoPointFieldScript; +import org.elasticsearch.script.GeoPointFieldScript; import org.elasticsearch.script.Script; public class GeoPointScriptFieldExistsQuery extends AbstractGeoPointScriptFieldQuery { diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldGeoShapeQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/GeoPointScriptFieldGeoShapeQuery.java similarity index 98% rename from server/src/main/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldGeoShapeQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/GeoPointScriptFieldGeoShapeQuery.java index 0d929bee30ad0..0faa847d4de0e 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldGeoShapeQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/GeoPointScriptFieldGeoShapeQuery.java @@ -6,13 +6,13 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.geo.Component2D; import org.apache.lucene.geo.GeoEncodingUtils; import org.apache.lucene.geo.LatLonGeometry; import org.elasticsearch.common.geo.ShapeRelation; -import org.elasticsearch.runtimefields.mapper.GeoPointFieldScript; +import org.elasticsearch.script.GeoPointFieldScript; import org.elasticsearch.script.Script; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/IpScriptFieldExistsQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/IpScriptFieldExistsQuery.java similarity index 90% rename from server/src/main/java/org/elasticsearch/runtimefields/query/IpScriptFieldExistsQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/IpScriptFieldExistsQuery.java index 8db71c21fc5cf..abab5970bd58f 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/IpScriptFieldExistsQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/IpScriptFieldExistsQuery.java @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.runtimefields.mapper.IpFieldScript; +import org.elasticsearch.script.IpFieldScript; import org.elasticsearch.script.Script; public class IpScriptFieldExistsQuery extends AbstractIpScriptFieldQuery { diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/IpScriptFieldRangeQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/IpScriptFieldRangeQuery.java similarity index 95% rename from server/src/main/java/org/elasticsearch/runtimefields/query/IpScriptFieldRangeQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/IpScriptFieldRangeQuery.java index f4ed9a6848a80..30c20564d34fe 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/IpScriptFieldRangeQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/IpScriptFieldRangeQuery.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.network.InetAddresses; -import org.elasticsearch.runtimefields.mapper.IpFieldScript; +import org.elasticsearch.script.IpFieldScript; import org.elasticsearch.script.Script; import java.net.InetAddress; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/IpScriptFieldTermQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/IpScriptFieldTermQuery.java similarity index 94% rename from server/src/main/java/org/elasticsearch/runtimefields/query/IpScriptFieldTermQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/IpScriptFieldTermQuery.java index ff921f6f1a267..ec25b2bd4bd86 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/IpScriptFieldTermQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/IpScriptFieldTermQuery.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.network.InetAddresses; -import org.elasticsearch.runtimefields.mapper.IpFieldScript; +import org.elasticsearch.script.IpFieldScript; import org.elasticsearch.script.Script; import java.net.InetAddress; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/IpScriptFieldTermsQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/IpScriptFieldTermsQuery.java similarity index 96% rename from server/src/main/java/org/elasticsearch/runtimefields/query/IpScriptFieldTermsQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/IpScriptFieldTermsQuery.java index 343d29ed2967a..b1f5d99b1ca4d 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/IpScriptFieldTermsQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/IpScriptFieldTermsQuery.java @@ -6,12 +6,12 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.network.InetAddresses; import org.elasticsearch.common.util.BytesRefHash; -import org.elasticsearch.runtimefields.mapper.IpFieldScript; +import org.elasticsearch.script.IpFieldScript; import org.elasticsearch.script.Script; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldDistanceFeatureQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldDistanceFeatureQuery.java similarity index 98% rename from server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldDistanceFeatureQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldDistanceFeatureQuery.java index e1eb0ff645b3e..f0b9a76bb65da 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldDistanceFeatureQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldDistanceFeatureQuery.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.Term; @@ -18,7 +18,7 @@ import org.apache.lucene.search.Scorer; import org.apache.lucene.search.TwoPhaseIterator; import org.apache.lucene.search.Weight; -import org.elasticsearch.runtimefields.mapper.AbstractLongFieldScript; +import org.elasticsearch.script.AbstractLongFieldScript; import org.elasticsearch.script.Script; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldExistsQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldExistsQuery.java similarity index 90% rename from server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldExistsQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldExistsQuery.java index 065f66f5ed65c..9a44f34a96280 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldExistsQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldExistsQuery.java @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.LeafReaderContext; -import org.elasticsearch.runtimefields.mapper.AbstractLongFieldScript; +import org.elasticsearch.script.AbstractLongFieldScript; import org.elasticsearch.script.Script; import java.util.function.Function; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldRangeQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldRangeQuery.java similarity index 94% rename from server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldRangeQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldRangeQuery.java index 1a76754e790d0..3e2aa464774fc 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldRangeQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldRangeQuery.java @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.LeafReaderContext; -import org.elasticsearch.runtimefields.mapper.AbstractLongFieldScript; +import org.elasticsearch.script.AbstractLongFieldScript; import org.elasticsearch.script.Script; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldTermQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldTermQuery.java similarity index 93% rename from server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldTermQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldTermQuery.java index aef02549c225d..554ab402a0536 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldTermQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldTermQuery.java @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.LeafReaderContext; -import org.elasticsearch.runtimefields.mapper.AbstractLongFieldScript; +import org.elasticsearch.script.AbstractLongFieldScript; import org.elasticsearch.script.Script; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldTermsQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldTermsQuery.java similarity index 93% rename from server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldTermsQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldTermsQuery.java index 4410d40feb724..805877c5a50a7 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/LongScriptFieldTermsQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/LongScriptFieldTermsQuery.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import com.carrotsearch.hppc.LongSet; import org.apache.lucene.index.LeafReaderContext; -import org.elasticsearch.runtimefields.mapper.AbstractLongFieldScript; +import org.elasticsearch.script.AbstractLongFieldScript; import org.elasticsearch.script.Script; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldExistsQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldExistsQuery.java similarity index 90% rename from server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldExistsQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldExistsQuery.java index 28724f697c5fe..70cb634d9c7fa 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldExistsQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldExistsQuery.java @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.Script; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldFuzzyQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldFuzzyQuery.java similarity index 95% rename from server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldFuzzyQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldFuzzyQuery.java index fa4c8d5d794f1..c50fb3e7ea882 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldFuzzyQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldFuzzyQuery.java @@ -6,12 +6,12 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.Term; import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.util.automaton.ByteRunAutomaton; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.Script; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldPrefixQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldPrefixQuery.java similarity index 97% rename from server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldPrefixQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldPrefixQuery.java index 25a35d23b718d..3d6c6ea27d7a8 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldPrefixQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldPrefixQuery.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.search.PrefixQuery; import org.apache.lucene.search.QueryVisitor; @@ -14,7 +14,7 @@ import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.ByteRunAutomaton; import org.elasticsearch.common.lucene.search.AutomatonQueries; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.Script; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldRangeQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldRangeQuery.java similarity index 97% rename from server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldRangeQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldRangeQuery.java index e455e2b080b3f..6fb3c069e3f7c 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldRangeQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldRangeQuery.java @@ -6,13 +6,13 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.search.QueryVisitor; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.ByteRunAutomaton; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.Script; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldRegexpQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldRegexpQuery.java similarity index 95% rename from server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldRegexpQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldRegexpQuery.java index 0eb39bbafd996..327eda5ff222e 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldRegexpQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldRegexpQuery.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.automaton.ByteRunAutomaton; import org.apache.lucene.util.automaton.RegExp; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.Script; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldTermQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldTermQuery.java similarity index 95% rename from server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldTermQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldTermQuery.java index 066ca4d063b36..9441fa4b4be48 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldTermQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldTermQuery.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.Term; import org.apache.lucene.search.QueryVisitor; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.Script; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldTermsQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldTermsQuery.java similarity index 94% rename from server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldTermsQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldTermsQuery.java index 6fff6d879eb2a..eb46701565e5f 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldTermsQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldTermsQuery.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.Term; import org.apache.lucene.search.QueryVisitor; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.Script; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldWildcardQuery.java b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldWildcardQuery.java similarity index 95% rename from server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldWildcardQuery.java rename to server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldWildcardQuery.java index 72e52c8565f8a..2d071697b54eb 100644 --- a/server/src/main/java/org/elasticsearch/runtimefields/query/StringScriptFieldWildcardQuery.java +++ b/server/src/main/java/org/elasticsearch/search/runtime/StringScriptFieldWildcardQuery.java @@ -6,14 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.Term; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.ByteRunAutomaton; import org.elasticsearch.common.lucene.search.AutomatonQueries; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.script.Script; import java.util.Objects; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/AbstractNonTextScriptFieldTypeTestCase.java b/server/src/test/java/org/elasticsearch/index/mapper/AbstractNonTextScriptFieldTypeTestCase.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/AbstractNonTextScriptFieldTypeTestCase.java rename to server/src/test/java/org/elasticsearch/index/mapper/AbstractNonTextScriptFieldTypeTestCase.java index 7882c485c6a82..18d4b91135ac4 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/AbstractNonTextScriptFieldTypeTestCase.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/AbstractNonTextScriptFieldTypeTestCase.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.util.automaton.Operations; import org.elasticsearch.common.unit.Fuzziness; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/AbstractScriptFieldTypeTestCase.java b/server/src/test/java/org/elasticsearch/index/mapper/AbstractScriptFieldTypeTestCase.java similarity index 97% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/AbstractScriptFieldTypeTestCase.java rename to server/src/test/java/org/elasticsearch/index/mapper/AbstractScriptFieldTypeTestCase.java index e6ff6f6591e03..32d96cd9ee916 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/AbstractScriptFieldTypeTestCase.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/AbstractScriptFieldTypeTestCase.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexReader; import org.apache.lucene.search.Query; @@ -19,13 +19,16 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.MapperServiceTestCase; import org.elasticsearch.index.query.SearchExecutionContext; +import org.elasticsearch.script.BooleanFieldScript; +import org.elasticsearch.script.DateFieldScript; +import org.elasticsearch.script.DoubleFieldScript; +import org.elasticsearch.script.GeoPointFieldScript; +import org.elasticsearch.script.IpFieldScript; +import org.elasticsearch.script.LongFieldScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptContext; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.search.lookup.SearchLookup; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/BooleanFieldScriptTests.java b/server/src/test/java/org/elasticsearch/index/mapper/BooleanFieldScriptTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/BooleanFieldScriptTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/BooleanFieldScriptTests.java index e0651b9fc320f..1a41b2c1d2d88 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/BooleanFieldScriptTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/BooleanFieldScriptTests.java @@ -6,13 +6,15 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.script.AbstractFieldScript; +import org.elasticsearch.script.BooleanFieldScript; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.search.lookup.SearchLookup; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/BooleanScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/BooleanScriptFieldTypeTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/BooleanScriptFieldTypeTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/BooleanScriptFieldTypeTests.java index 8eb2f5fa68a3f..913e34aa22c39 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/BooleanScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/BooleanScriptFieldTypeTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; @@ -33,13 +33,9 @@ import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.index.fielddata.ScriptDocValues; -import org.elasticsearch.index.mapper.BooleanFieldMapper; -import org.elasticsearch.index.mapper.ContentPath; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.SourceToParse; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.BooleanScriptFieldData; +import org.elasticsearch.index.fielddata.BooleanScriptFieldData; +import org.elasticsearch.script.BooleanFieldScript; import org.elasticsearch.script.ScoreScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/DateFieldScriptTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DateFieldScriptTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/DateFieldScriptTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/DateFieldScriptTests.java index e9895e0afb983..ff5cfbbeef240 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/DateFieldScriptTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DateFieldScriptTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; @@ -14,6 +14,8 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.time.DateFormatter; +import org.elasticsearch.script.AbstractFieldScript; +import org.elasticsearch.script.DateFieldScript; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.search.lookup.SearchLookup; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/DateScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DateScriptFieldTypeTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/DateScriptFieldTypeTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/DateScriptFieldTypeTests.java index 0bd8eb5061122..608869a91beda 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/DateScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DateScriptFieldTypeTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; @@ -37,12 +37,9 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.fielddata.ScriptDocValues; -import org.elasticsearch.index.mapper.DateFieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.DateScriptFieldData; +import org.elasticsearch.index.fielddata.DateScriptFieldData; +import org.elasticsearch.script.DateFieldScript; import org.elasticsearch.script.ScoreScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/DoubleFieldScriptTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DoubleFieldScriptTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/DoubleFieldScriptTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/DoubleFieldScriptTests.java index 85e7b3c8cb877..09f48dbeee4b5 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/DoubleFieldScriptTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DoubleFieldScriptTests.java @@ -6,13 +6,15 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.script.AbstractFieldScript; +import org.elasticsearch.script.DoubleFieldScript; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.search.lookup.SearchLookup; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/DoubleScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DoubleScriptFieldTypeTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/DoubleScriptFieldTypeTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/DoubleScriptFieldTypeTests.java index 4a36751ee2a6a..70ec313a1bc76 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/DoubleScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DoubleScriptFieldTypeTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; @@ -28,9 +28,9 @@ import org.elasticsearch.common.lucene.search.function.ScriptScoreQuery; import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.index.fielddata.SortedNumericDoubleValues; -import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.DoubleScriptFieldData; +import org.elasticsearch.index.fielddata.DoubleScriptFieldData; +import org.elasticsearch.script.DoubleFieldScript; import org.elasticsearch.script.ScoreScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/DynamicRuntimeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DynamicRuntimeTests.java similarity index 99% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/DynamicRuntimeTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/DynamicRuntimeTests.java index 94b2c8930d39d..31ecd33dada0a 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/DynamicRuntimeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DynamicRuntimeTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.Strings; import org.elasticsearch.index.mapper.DocumentMapper; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/FieldScriptTestCase.java b/server/src/test/java/org/elasticsearch/index/mapper/FieldScriptTestCase.java similarity index 96% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/FieldScriptTestCase.java rename to server/src/test/java/org/elasticsearch/index/mapper/FieldScriptTestCase.java index 4875930ff7c4f..5cc9f7c030b41 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/FieldScriptTestCase.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/FieldScriptTestCase.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptContext; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/GeoPointFieldScriptTests.java b/server/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldScriptTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/GeoPointFieldScriptTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldScriptTests.java index e45697ba86ce6..795ac0ba2000c 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/GeoPointFieldScriptTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldScriptTests.java @@ -6,13 +6,15 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.script.AbstractFieldScript; +import org.elasticsearch.script.GeoPointFieldScript; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.search.lookup.SearchLookup; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/GeoPointScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/GeoPointScriptFieldTypeTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/GeoPointScriptFieldTypeTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/GeoPointScriptFieldTypeTests.java index c3453842de2be..b6cb9763d3335 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/GeoPointScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/GeoPointScriptFieldTypeTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; @@ -27,9 +27,9 @@ import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.index.fielddata.MultiGeoPointValues; import org.elasticsearch.index.fielddata.ScriptDocValues; -import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.GeoPointScriptFieldData; +import org.elasticsearch.index.fielddata.GeoPointScriptFieldData; +import org.elasticsearch.script.GeoPointFieldScript; import org.elasticsearch.script.ScoreScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/IpFieldScriptTests.java b/server/src/test/java/org/elasticsearch/index/mapper/IpFieldScriptTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/IpFieldScriptTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/IpFieldScriptTests.java index ceaa83dc64c62..3913720b24089 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/IpFieldScriptTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/IpFieldScriptTests.java @@ -6,13 +6,15 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.script.AbstractFieldScript; +import org.elasticsearch.script.IpFieldScript; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.search.lookup.SearchLookup; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/IpScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/IpScriptFieldTypeTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/IpScriptFieldTypeTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/IpScriptFieldTypeTests.java index 2fa895b35b270..266d629e28341 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/IpScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/IpScriptFieldTypeTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; @@ -27,10 +27,10 @@ import org.elasticsearch.Version; import org.elasticsearch.common.lucene.search.function.ScriptScoreQuery; import org.elasticsearch.index.fielddata.SortedBinaryDocValues; -import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.BinaryScriptFieldData; -import org.elasticsearch.runtimefields.fielddata.IpScriptFieldData; +import org.elasticsearch.index.fielddata.BinaryScriptFieldData; +import org.elasticsearch.index.fielddata.IpScriptFieldData; +import org.elasticsearch.script.IpFieldScript; import org.elasticsearch.script.ScoreScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/KeywordScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/KeywordScriptFieldTypeTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/KeywordScriptFieldTypeTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/KeywordScriptFieldTypeTests.java index 96d936014175a..d0bf3638d7f62 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/KeywordScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/KeywordScriptFieldTypeTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; @@ -30,14 +30,14 @@ import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.index.fielddata.SortedBinaryDocValues; -import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.BinaryScriptFieldData; -import org.elasticsearch.runtimefields.fielddata.StringScriptFieldData; +import org.elasticsearch.index.fielddata.BinaryScriptFieldData; +import org.elasticsearch.index.fielddata.StringScriptFieldData; import org.elasticsearch.script.ScoreScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.search.MultiValueMode; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/LongFieldScriptTests.java b/server/src/test/java/org/elasticsearch/index/mapper/LongFieldScriptTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/LongFieldScriptTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/LongFieldScriptTests.java index 36ec10e9e1479..2e50077efb3f4 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/LongFieldScriptTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/LongFieldScriptTests.java @@ -6,13 +6,15 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.script.AbstractFieldScript; +import org.elasticsearch.script.LongFieldScript; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.search.lookup.SearchLookup; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/LongScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/LongScriptFieldTypeTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/LongScriptFieldTypeTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/LongScriptFieldTypeTests.java index 594bbfd11e46d..049c2800e0a49 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/LongScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/LongScriptFieldTypeTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; @@ -30,11 +30,9 @@ import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.lucene.search.function.ScriptScoreQuery; import org.elasticsearch.index.fielddata.ScriptDocValues; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.runtimefields.fielddata.LongScriptFieldData; +import org.elasticsearch.index.fielddata.LongScriptFieldData; +import org.elasticsearch.script.LongFieldScript; import org.elasticsearch.script.ScoreScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/RootObjectMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/RootObjectMapperTests.java index 215fdd9e3870d..66f66d1a19a18 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/RootObjectMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/RootObjectMapperTests.java @@ -15,9 +15,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.MapperService.MergeReason; -import org.elasticsearch.runtimefields.mapper.DoubleScriptFieldType; -import org.elasticsearch.runtimefields.mapper.KeywordScriptFieldType; -import org.elasticsearch.runtimefields.mapper.LongScriptFieldType; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/StringFieldScriptTests.java b/server/src/test/java/org/elasticsearch/index/mapper/StringFieldScriptTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/StringFieldScriptTests.java rename to server/src/test/java/org/elasticsearch/index/mapper/StringFieldScriptTests.java index 51e0983797b63..78400417f4a31 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/StringFieldScriptTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/StringFieldScriptTests.java @@ -6,14 +6,16 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.script.AbstractFieldScript; import org.elasticsearch.script.ScriptContext; +import org.elasticsearch.script.StringFieldScript; import org.elasticsearch.search.lookup.SearchLookup; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/mapper/TestScriptEngine.java b/server/src/test/java/org/elasticsearch/index/mapper/TestScriptEngine.java similarity index 97% rename from server/src/test/java/org/elasticsearch/runtimefields/mapper/TestScriptEngine.java rename to server/src/test/java/org/elasticsearch/index/mapper/TestScriptEngine.java index c4d4639bcf331..b0009473bd08f 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/mapper/TestScriptEngine.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/TestScriptEngine.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.mapper; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.script.ScriptContext; diff --git a/server/src/test/java/org/elasticsearch/index/query/SearchExecutionContextTests.java b/server/src/test/java/org/elasticsearch/index/query/SearchExecutionContextTests.java index 1e5fa2cc13778..7e2b22c04d225 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SearchExecutionContextTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SearchExecutionContextTests.java @@ -59,8 +59,8 @@ import org.elasticsearch.index.mapper.TestRuntimeField; import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.indices.IndicesModule; -import org.elasticsearch.runtimefields.mapper.KeywordScriptFieldType; -import org.elasticsearch.runtimefields.mapper.LongScriptFieldType; +import org.elasticsearch.index.mapper.KeywordScriptFieldType; +import org.elasticsearch.index.mapper.LongScriptFieldType; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.MultiValueMode; import org.elasticsearch.search.aggregations.support.ValuesSourceType; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractBooleanScriptFieldQueryTestCase.java b/server/src/test/java/org/elasticsearch/search/runtime/AbstractBooleanScriptFieldQueryTestCase.java similarity index 93% rename from server/src/test/java/org/elasticsearch/runtimefields/query/AbstractBooleanScriptFieldQueryTestCase.java rename to server/src/test/java/org/elasticsearch/search/runtime/AbstractBooleanScriptFieldQueryTestCase.java index c78c4e311cc04..7cc82dfc24c31 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractBooleanScriptFieldQueryTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/AbstractBooleanScriptFieldQueryTestCase.java @@ -6,13 +6,13 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; import org.apache.lucene.search.QueryVisitor; import org.apache.lucene.util.automaton.ByteRunAutomaton; -import org.elasticsearch.runtimefields.mapper.BooleanFieldScript; +import org.elasticsearch.script.BooleanFieldScript; import java.util.ArrayList; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractDoubleScriptFieldQueryTestCase.java b/server/src/test/java/org/elasticsearch/search/runtime/AbstractDoubleScriptFieldQueryTestCase.java similarity index 86% rename from server/src/test/java/org/elasticsearch/runtimefields/query/AbstractDoubleScriptFieldQueryTestCase.java rename to server/src/test/java/org/elasticsearch/search/runtime/AbstractDoubleScriptFieldQueryTestCase.java index ef19cd9d24522..5b0a613c7863c 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractDoubleScriptFieldQueryTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/AbstractDoubleScriptFieldQueryTestCase.java @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; +import org.elasticsearch.script.DoubleFieldScript; import static org.mockito.Mockito.mock; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractGeoPointScriptFieldQueryTestCase.java b/server/src/test/java/org/elasticsearch/search/runtime/AbstractGeoPointScriptFieldQueryTestCase.java similarity index 86% rename from server/src/test/java/org/elasticsearch/runtimefields/query/AbstractGeoPointScriptFieldQueryTestCase.java rename to server/src/test/java/org/elasticsearch/search/runtime/AbstractGeoPointScriptFieldQueryTestCase.java index 073f4cd63ef18..98c34c24aa267 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractGeoPointScriptFieldQueryTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/AbstractGeoPointScriptFieldQueryTestCase.java @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; -import org.elasticsearch.runtimefields.mapper.GeoPointFieldScript; +import org.elasticsearch.script.GeoPointFieldScript; import static org.mockito.Mockito.mock; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractIpScriptFieldQueryTestCase.java b/server/src/test/java/org/elasticsearch/search/runtime/AbstractIpScriptFieldQueryTestCase.java similarity index 90% rename from server/src/test/java/org/elasticsearch/runtimefields/query/AbstractIpScriptFieldQueryTestCase.java rename to server/src/test/java/org/elasticsearch/search/runtime/AbstractIpScriptFieldQueryTestCase.java index 27c186e5ad7ec..b4341e3385ed0 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractIpScriptFieldQueryTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/AbstractIpScriptFieldQueryTestCase.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.document.InetAddressPoint; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.runtimefields.mapper.IpFieldScript; +import org.elasticsearch.script.IpFieldScript; import java.net.InetAddress; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractLongScriptFieldQueryTestCase.java b/server/src/test/java/org/elasticsearch/search/runtime/AbstractLongScriptFieldQueryTestCase.java similarity index 86% rename from server/src/test/java/org/elasticsearch/runtimefields/query/AbstractLongScriptFieldQueryTestCase.java rename to server/src/test/java/org/elasticsearch/search/runtime/AbstractLongScriptFieldQueryTestCase.java index b668edbe65f11..0c96c004c4a66 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractLongScriptFieldQueryTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/AbstractLongScriptFieldQueryTestCase.java @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.LeafReaderContext; -import org.elasticsearch.runtimefields.mapper.AbstractLongFieldScript; +import org.elasticsearch.script.AbstractLongFieldScript; import java.util.function.Function; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractScriptFieldQueryTestCase.java b/server/src/test/java/org/elasticsearch/search/runtime/AbstractScriptFieldQueryTestCase.java similarity index 95% rename from server/src/test/java/org/elasticsearch/runtimefields/query/AbstractScriptFieldQueryTestCase.java rename to server/src/test/java/org/elasticsearch/search/runtime/AbstractScriptFieldQueryTestCase.java index 18abbdb2fc5d3..adf44bf37a8cb 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractScriptFieldQueryTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/AbstractScriptFieldQueryTestCase.java @@ -6,13 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; import org.apache.lucene.search.QueryVisitor; import org.apache.lucene.util.automaton.ByteRunAutomaton; import org.elasticsearch.script.Script; +import org.elasticsearch.search.runtime.AbstractScriptFieldQuery; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractScriptFieldQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/AbstractScriptFieldQueryTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/runtimefields/query/AbstractScriptFieldQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/AbstractScriptFieldQueryTests.java index aa1adef736676..5f7838915b5af 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractScriptFieldQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/AbstractScriptFieldQueryTests.java @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.search.Explanation; -import org.elasticsearch.runtimefields.mapper.AbstractFieldScript; +import org.elasticsearch.script.AbstractFieldScript; import org.elasticsearch.script.Script; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractStringScriptFieldQueryTestCase.java b/server/src/test/java/org/elasticsearch/search/runtime/AbstractStringScriptFieldQueryTestCase.java similarity index 94% rename from server/src/test/java/org/elasticsearch/runtimefields/query/AbstractStringScriptFieldQueryTestCase.java rename to server/src/test/java/org/elasticsearch/search/runtime/AbstractStringScriptFieldQueryTestCase.java index 9ae83d663d4d6..9061d29b01f63 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/AbstractStringScriptFieldQueryTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/AbstractStringScriptFieldQueryTestCase.java @@ -6,13 +6,13 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; import org.apache.lucene.search.QueryVisitor; import org.apache.lucene.util.automaton.ByteRunAutomaton; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; +import org.elasticsearch.script.StringFieldScript; import java.util.ArrayList; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/BooleanScriptFieldExistsQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/BooleanScriptFieldExistsQueryTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/runtimefields/query/BooleanScriptFieldExistsQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/BooleanScriptFieldExistsQueryTests.java index 2c306bc246a64..905cd6c937b0c 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/BooleanScriptFieldExistsQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/BooleanScriptFieldExistsQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/BooleanScriptFieldTermQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/BooleanScriptFieldTermQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/BooleanScriptFieldTermQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/BooleanScriptFieldTermQueryTests.java index 996ad88afc8f1..651a7a29af02f 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/BooleanScriptFieldTermQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/BooleanScriptFieldTermQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.elasticsearch.script.Script; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldExistsQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/DoubleScriptFieldExistsQueryTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldExistsQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/DoubleScriptFieldExistsQueryTests.java index 565f4803a88ab..5a4522c9a732e 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldExistsQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/DoubleScriptFieldExistsQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldRangeQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/DoubleScriptFieldRangeQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldRangeQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/DoubleScriptFieldRangeQueryTests.java index 179a0447ef325..21ec95003c8c0 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldRangeQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/DoubleScriptFieldRangeQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.elasticsearch.script.Script; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldTermQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/DoubleScriptFieldTermQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldTermQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/DoubleScriptFieldTermQueryTests.java index 2e6b63f839a02..7298d90621355 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldTermQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/DoubleScriptFieldTermQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.elasticsearch.script.Script; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldTermsQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/DoubleScriptFieldTermsQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldTermsQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/DoubleScriptFieldTermsQueryTests.java index 2a926a62f630a..f5358366bc60f 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/DoubleScriptFieldTermsQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/DoubleScriptFieldTermsQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import com.carrotsearch.hppc.LongHashSet; import com.carrotsearch.hppc.LongSet; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldDistanceFeatureQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/GeoPointScriptFieldDistanceFeatureQueryTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldDistanceFeatureQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/GeoPointScriptFieldDistanceFeatureQueryTests.java index bd5463a26003f..1b1d4953f4b30 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldDistanceFeatureQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/GeoPointScriptFieldDistanceFeatureQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.document.StoredField; import org.apache.lucene.geo.GeoTestUtil; @@ -20,8 +20,8 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoUtils; -import org.elasticsearch.runtimefields.mapper.AbstractLongFieldScript; -import org.elasticsearch.runtimefields.mapper.GeoPointFieldScript; +import org.elasticsearch.script.AbstractLongFieldScript; +import org.elasticsearch.script.GeoPointFieldScript; import org.elasticsearch.script.Script; import org.elasticsearch.search.lookup.SearchLookup; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldExistsQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/GeoPointScriptFieldExistsQueryTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldExistsQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/GeoPointScriptFieldExistsQueryTests.java index ab075d3772605..4099fc9df7675 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldExistsQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/GeoPointScriptFieldExistsQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldGeoShapeQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/GeoPointScriptFieldGeoShapeQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldGeoShapeQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/GeoPointScriptFieldGeoShapeQueryTests.java index 79f15428da409..e4b8075491748 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/GeoPointScriptFieldGeoShapeQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/GeoPointScriptFieldGeoShapeQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.geo.Polygon; import org.elasticsearch.common.geo.ShapeRelation; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/IpScriptFieldExistsQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/IpScriptFieldExistsQueryTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/runtimefields/query/IpScriptFieldExistsQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/IpScriptFieldExistsQueryTests.java index 2df60dccac286..b50b594b7ca28 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/IpScriptFieldExistsQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/IpScriptFieldExistsQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.BytesRef; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/IpScriptFieldRangeQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/IpScriptFieldRangeQueryTests.java similarity index 99% rename from server/src/test/java/org/elasticsearch/runtimefields/query/IpScriptFieldRangeQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/IpScriptFieldRangeQueryTests.java index 1ba0010e02261..e423eea2a5aa4 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/IpScriptFieldRangeQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/IpScriptFieldRangeQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.network.InetAddresses; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/IpScriptFieldTermQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/IpScriptFieldTermQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/IpScriptFieldTermQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/IpScriptFieldTermQueryTests.java index 7439836cc3790..881dbb91638c3 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/IpScriptFieldTermQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/IpScriptFieldTermQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.network.InetAddresses; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/IpScriptFieldTermsQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/IpScriptFieldTermsQueryTests.java similarity index 99% rename from server/src/test/java/org/elasticsearch/runtimefields/query/IpScriptFieldTermsQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/IpScriptFieldTermsQueryTests.java index 1234033689a1d..83401422ddc57 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/IpScriptFieldTermsQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/IpScriptFieldTermsQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.document.InetAddressPoint; import org.apache.lucene.util.BytesRef; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldDistanceFeatureQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldDistanceFeatureQueryTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldDistanceFeatureQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldDistanceFeatureQueryTests.java index c6ae9e584dc06..bdbc1abfd015d 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldDistanceFeatureQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldDistanceFeatureQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; @@ -17,8 +17,8 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.runtimefields.mapper.AbstractLongFieldScript; -import org.elasticsearch.runtimefields.mapper.DateFieldScript; +import org.elasticsearch.script.AbstractLongFieldScript; +import org.elasticsearch.script.DateFieldScript; import org.elasticsearch.script.Script; import org.elasticsearch.search.lookup.SearchLookup; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldExistsQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldExistsQueryTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldExistsQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldExistsQueryTests.java index 095f580fb7a91..89769eda0cead 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldExistsQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldExistsQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldRangeQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldRangeQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldRangeQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldRangeQueryTests.java index 20368894f0b1e..a272ccec43cf4 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldRangeQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldRangeQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.elasticsearch.script.Script; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldTermQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldTermQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldTermQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldTermQueryTests.java index 26a999b78ebda..b44b8c0f923d0 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldTermQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldTermQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.elasticsearch.script.Script; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldTermsQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldTermsQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldTermsQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldTermsQueryTests.java index 35a01caeae560..da7eab3d349cf 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/LongScriptFieldTermsQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/LongScriptFieldTermsQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import com.carrotsearch.hppc.LongHashSet; import com.carrotsearch.hppc.LongSet; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldExistsQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldExistsQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldExistsQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldExistsQueryTests.java index c77ab61cbd482..196fef5e22a6c 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldExistsQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldExistsQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldFuzzyQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldFuzzyQueryTests.java similarity index 99% rename from server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldFuzzyQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldFuzzyQueryTests.java index c1f1018197b6d..a7555fe64b5f9 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldFuzzyQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldFuzzyQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.automaton.ByteRunAutomaton; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldPrefixQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldPrefixQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldPrefixQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldPrefixQueryTests.java index 902a002828ade..f92a17a758b8a 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldPrefixQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldPrefixQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.automaton.ByteRunAutomaton; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldRangeQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldRangeQueryTests.java similarity index 99% rename from server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldRangeQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldRangeQueryTests.java index cd6214addd537..d67da7ea0a587 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldRangeQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldRangeQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.automaton.ByteRunAutomaton; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldRegexpQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldRegexpQueryTests.java similarity index 99% rename from server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldRegexpQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldRegexpQueryTests.java index 17c4259598d6a..479b2fe26748c 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldRegexpQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldRegexpQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.automaton.ByteRunAutomaton; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldTermQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldTermQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldTermQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldTermQueryTests.java index 563a6348f95aa..a381d7ce8c996 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldTermQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldTermQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldTermsQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldTermsQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldTermsQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldTermsQueryTests.java index 832ff3f0dd52a..4cc00706ff89b 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldTermsQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldTermsQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; diff --git a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldWildcardQueryTests.java b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldWildcardQueryTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldWildcardQueryTests.java rename to server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldWildcardQueryTests.java index 215d36b393d4e..fe4992f14645e 100644 --- a/server/src/test/java/org/elasticsearch/runtimefields/query/StringScriptFieldWildcardQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/runtime/StringScriptFieldWildcardQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.runtimefields.query; +package org.elasticsearch.search.runtime; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.automaton.ByteRunAutomaton; diff --git a/test/framework/src/main/java/org/elasticsearch/script/MockScriptEngine.java b/test/framework/src/main/java/org/elasticsearch/script/MockScriptEngine.java index bc5b2439ad683..db44048eec153 100644 --- a/test/framework/src/main/java/org/elasticsearch/script/MockScriptEngine.java +++ b/test/framework/src/main/java/org/elasticsearch/script/MockScriptEngine.java @@ -15,13 +15,6 @@ import org.elasticsearch.index.similarity.ScriptedSimilarity.Field; import org.elasticsearch.index.similarity.ScriptedSimilarity.Query; import org.elasticsearch.index.similarity.ScriptedSimilarity.Term; -import org.elasticsearch.runtimefields.mapper.BooleanFieldScript; -import org.elasticsearch.runtimefields.mapper.DateFieldScript; -import org.elasticsearch.runtimefields.mapper.DoubleFieldScript; -import org.elasticsearch.runtimefields.mapper.GeoPointFieldScript; -import org.elasticsearch.runtimefields.mapper.IpFieldScript; -import org.elasticsearch.runtimefields.mapper.LongFieldScript; -import org.elasticsearch.runtimefields.mapper.StringFieldScript; import org.elasticsearch.search.aggregations.pipeline.MovingFunctionScript; import org.elasticsearch.search.lookup.LeafSearchLookup; import org.elasticsearch.search.lookup.SearchLookup;