|
@@ -583,6 +583,16 @@ public class IndexRoutingTests extends ESTestCase {
|
|
|
assertIndexShard(routing, Map.of("foo.bar", "cat", "baz", "dog"), Math.floorMod(hash(List.of("foo.bar", "cat")), shards));
|
|
|
}
|
|
|
|
|
|
+ public void testRoutingPathNumbersInSource() throws IOException {
|
|
|
+ int shards = between(2, 1000);
|
|
|
+ IndexRouting routing = indexRoutingForPath(shards, "foo");
|
|
|
+ long randomLong = randomLong();
|
|
|
+ assertIndexShard(routing, Map.of("foo", randomLong), Math.floorMod(hash(List.of("foo", Long.toString(randomLong))), shards));
|
|
|
+ double randomDouble = randomDouble();
|
|
|
+ assertIndexShard(routing, Map.of("foo", randomDouble), Math.floorMod(hash(List.of("foo", Double.toString(randomDouble))), shards));
|
|
|
+ assertIndexShard(routing, Map.of("foo", 123), Math.floorMod(hash(List.of("foo", "123")), shards));
|
|
|
+ }
|
|
|
+
|
|
|
public void testRoutingPathBwc() throws IOException {
|
|
|
IndexVersion version = IndexVersionUtils.randomCompatibleVersion(random());
|
|
|
IndexRouting routing = indexRoutingForPath(version, 8, "dim.*,other.*,top");
|