@@ -35,19 +35,19 @@ class ConfigurableIndicesTest extends Specification with LazyLogging {
3535 // creates a default attribute index on name and an implicit default z3 and z2 index on geom
3636 ds.createSchema(SimpleFeatureTypes .createType(" test1" , " name:String:index=true,dtg:Date,*geom:Point:srid=4326" ))
3737 // creates an attribute index on name (with a secondary date index), and a z3 index on geom and dtg
38- ds.createSchema(SimpleFeatureTypes .createType(" test2" , " name:String:index='attr:dtg',dtg:Date,*geom:Point:srid=4326:index='z3:dtg'" ))
38+ ds.createSchema(SimpleFeatureTypes .createType(" test2" , " name:String:index='attr:geom: dtg',dtg:Date,*geom:Point:srid=4326:index='z3:dtg'" ))
3939 // creates an attribute index on name (with a secondary date index), and a z3 index on geom and dtg and disables the ID index
4040 ds.createSchema(SimpleFeatureTypes .createType(" test3" , " name:String:index='attr:dtg',dtg:Date,*geom:Point:srid=4326:index='z3:dtg';id.index.enabled=false" ))
41- getIndexConfig(ds.getSchema(" test1" )) mustEqual Seq (" attr=name:geom: dtg" , " id=" , " z2=geom" , " z3=geom:dtg" )
42- getIndexConfig(ds.getSchema(" test2" )) mustEqual Seq (" attr=name:dtg" , " id=" , " z3=geom:dtg" )
41+ getIndexConfig(ds.getSchema(" test1" )) mustEqual Seq (" attr=name:dtg" , " id=" , " z2=geom" , " z3=geom:dtg" )
42+ getIndexConfig(ds.getSchema(" test2" )) mustEqual Seq (" attr=name:geom: dtg" , " id=" , " z3=geom:dtg" )
4343 getIndexConfig(ds.getSchema(" test3" )) mustEqual Seq (" attr=name:dtg" , " z3=geom:dtg" )
4444 }
4545 }
4646
4747 " support configurable indices with SchemaBuilder" in {
4848 val sft =
4949 SchemaBuilder .builder()
50- .addString(" name" ).withIndex(" attr:dtg" ) // creates an attribute index on name, with a secondary date index
50+ .addString(" name" ).withIndex(" attr:geom: dtg" ) // creates an attribute index on name, with a secondary date index
5151 .addInt(" age" ).withIndex() // creates an attribute index on age, with a default secondary index
5252 .addDate(" dtg" ) // not a primary index
5353 .addPoint(" geom" , default = true ).withIndices(" z3:dtg" , " z2" ) // creates a z3 index with dtg, and a z2 index
@@ -56,7 +56,7 @@ class ConfigurableIndicesTest extends Specification with LazyLogging {
5656 .build(" test1" )
5757 WithClose (new TestGeoMesaDataStore (true )) { ds =>
5858 ds.createSchema(sft)
59- getIndexConfig(ds.getSchema(" test1" )) mustEqual Seq (" attr=age:geom: dtg" , " attr=name:dtg" , " z2=geom" , " z3=geom:dtg" )
59+ getIndexConfig(ds.getSchema(" test1" )) mustEqual Seq (" attr=age:dtg" , " attr=name:geom :dtg" , " z2=geom" , " z3=geom:dtg" )
6060 }
6161 }
6262
@@ -65,7 +65,7 @@ class ConfigurableIndicesTest extends Specification with LazyLogging {
6565 s """ {
6666 | type-name = test1
6767 | attributes = [
68- | { name = "name", type = "String", index = "attr:dtg" } // creates an attribute index on name, with a secondary date index
68+ | { name = "name", type = "String", index = "attr:geom: dtg" } // creates an attribute index on name, with a secondary date index
6969 | { name = "age", type = "Int", index = "true" } // creates an attribute index on age, with a default secondary index
7070 | { name = "dtg", type = "Date" } // not a primary index
7171 | { name = "geom", type = "Point", srid = "4326", index = "z3:dtg,z2" } // creates a z3 index with dtg, and a z2 index
@@ -78,7 +78,7 @@ class ConfigurableIndicesTest extends Specification with LazyLogging {
7878 val sft = SimpleFeatureTypes .createType(ConfigFactory .parseString(config), path = None )
7979 WithClose (new TestGeoMesaDataStore (true )) { ds =>
8080 ds.createSchema(sft)
81- getIndexConfig(ds.getSchema(" test1" )) mustEqual Seq (" attr=age:geom: dtg" , " attr=name:dtg" , " z2=geom" , " z3=geom:dtg" )
81+ getIndexConfig(ds.getSchema(" test1" )) mustEqual Seq (" attr=age:dtg" , " attr=name:geom :dtg" , " z2=geom" , " z3=geom:dtg" )
8282 }
8383 }
8484 }
0 commit comments