Skip to content

Commit 5f88f94

Browse files
committed
Updates parent child specs
1 parent 3ebd8da commit 5f88f94

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

elasticsearch-model/spec/elasticsearch/model/adapters/active_record/parent_child_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
add_index(:answers, :question_id) unless index_exists?(:answers, :question_id)
3939

4040
clear_tables(Question)
41-
ParentChildSearchable.create_index!(force: true, include_type_name: true)
41+
ParentChildSearchable.create_index!(force: true)
4242

4343
q_1 = Question.create!(title: 'First Question', author: 'John')
4444
q_2 = Question.create!(title: 'Second Question', author: 'Jody')

elasticsearch-model/spec/support/app/parent_and_child_searchable.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ def create_index!(options={})
2626
settings = Question.settings.to_hash.merge Answer.settings.to_hash
2727
mapping_properties = { join_field: { type: JOIN,
2828
relations: { Question::JOIN_TYPE => Answer::JOIN_TYPE } } }
29-
30-
merged_properties = mapping_properties.merge(Question.mappings.to_hash[:doc][:properties]).merge(
31-
Answer.mappings.to_hash[:doc][:properties])
32-
mappings = { doc: { properties: merged_properties }}
29+
merged_properties = mapping_properties.merge(
30+
Question.mappings.to_hash[:properties]
31+
).merge(
32+
Answer.mappings.to_hash[:properties]
33+
)
34+
mappings = { properties: merged_properties }
3335

3436
client.indices.create({ index: INDEX_NAME,
3537
body: {

0 commit comments

Comments
 (0)