File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,15 @@ def todays_date
3232
3333 def mapping_name
3434 if ESHelper . es_version_satisfies? ( ">=7" )
35- "_doc"
35+ nil
3636 else
3737 "_default_"
3838 end
39+ end
3940
41+ def field_properties_from_template ( template_name , field )
42+ mappings = @es . indices . get_template ( name : template_name ) [ template_name ] [ "mappings" ]
43+ ( mapping_name . nil? ) ? mappings [ "properties" ] [ field ] [ "properties" ] : mappings [ mapping_name ] [ "properties" ] [ field ] [ "properties" ]
4044 end
4145
4246 def routing_field_name
Original file line number Diff line number Diff line change 7676
7777 shared_examples "a join field based parent indexer" do
7878 let ( :index ) { 10 . times . collect { rand ( 10 ) . to_s } . join ( "" ) }
79- let ( :type ) { 10 . times . collect { rand ( 10 ) . to_s } . join ( "" ) }
79+
80+ let ( :type ) do
81+ if ESHelper . es_version_satisfies? ( '<7' )
82+ 10 . times . collect { rand ( 10 ) . to_s } . join ( "" )
83+ else
84+ "_doc"
85+ end
86+ end
87+
8088 let ( :event_count ) { 10000 + rand ( 500 ) }
8189 let ( :parent ) { "not_implemented" }
8290 let ( :config ) { "not_implemented" }
Original file line number Diff line number Diff line change 8282 end
8383
8484 it "make [geoip][location] a geo_point" do
85- expect ( @es . indices . get_template ( name : "logstash" ) [ "logstash" ] [ "mappings" ] [ mapping_name ] [ "properties" ] [ " geoip"] [ "properties" ] [ "location" ] [ "type" ] ) . to eq ( "geo_point" )
85+ expect ( field_properties_from_template ( "logstash" , " geoip") [ "location" ] [ "type" ] ) . to eq ( "geo_point" )
8686 end
8787
8888 it "aggregate .keyword results correctly " do
You can’t perform that action at this time.
0 commit comments