From e0d6465af94b6c6f7b8d570dee97c98de572c876 Mon Sep 17 00:00:00 2001 From: David Smiley Date: Mon, 5 Mar 2018 10:52:02 -0500 Subject: [PATCH] LUCENE-8126: Add "s2" to SpatialPrefixTreeFactory lookup table --- .../lucene/spatial/prefix/tree/SpatialPrefixTreeFactory.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeFactory.java b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeFactory.java index 67480d52ff8..d88e41a76bb 100644 --- a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeFactory.java +++ b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeFactory.java @@ -43,6 +43,7 @@ public abstract class SpatialPrefixTreeFactory { * If it's neither of these, then "geohash" is chosen for a geo context, otherwise "quad" is chosen. */ public static SpatialPrefixTree makeSPT(Map args, ClassLoader classLoader, SpatialContext ctx) { + //TODO refactor to use Java SPI like how Lucene already does for codecs/postingsFormats, etc SpatialPrefixTreeFactory instance; String cname = args.get(PREFIX_TREE); if (cname == null) @@ -53,6 +54,8 @@ public abstract class SpatialPrefixTreeFactory { instance = new QuadPrefixTree.Factory(); else if ("packedQuad".equalsIgnoreCase(cname)) instance = new PackedQuadPrefixTree.Factory(); + else if ("s2".equalsIgnoreCase(cname)) + instance = new S2PrefixTree.Factory(); else { try { Class c = classLoader.loadClass(cname);