-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSV-5225: ignore nested documents that exceeds nested_objects_limit #2025
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -300,5 +300,29 @@ def setup | |
end | ||
end | ||
|
||
test "should ignore index task responses that exceeds nested objects limit" do | ||
team = create_team | ||
tt = create_team_task team_id: team.id, type: 'single_choice', options: ['ans_a', 'ans_b', 'ans_c'] | ||
tt2 = create_team_task team_id: team.id, type: 'single_choice', options: ['ans_aa', 'ans_bb', 'ans_cc'] | ||
tt3 = create_team_task team_id: team.id, type: 'single_choice', options: ['ans_aaa', 'ans_bbb', 'ans_ccc'] | ||
pm = create_project_media team: team | ||
stub_configs({ 'nested_objects_limit' => 2 }) do | ||
# answer single choice | ||
puts "Start to answer" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please delete this debugging line if you don't need it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK will do |
||
pm_tt = pm.annotations('task').select{|t| t.team_task_id == tt.id}.last | ||
pm_tt.response = { annotation_type: 'task_response_single_choice', set_fields: { response_single_choice: 'ans_a' }.to_json }.to_json | ||
pm_tt.save! | ||
# pm_tt2 = pm.annotations('task').select{|t| t.team_task_id == tt2.id}.last | ||
# pm_tt2.response = { annotation_type: 'task_response_single_choice', set_fields: { response_single_choice: 'ans_aa' }.to_json }.to_json | ||
# pm_tt2.save! | ||
# pm_tt3 = pm.annotations('task').select{|t| t.team_task_id == tt3.id}.last | ||
# pm_tt3.response = { annotation_type: 'task_response_single_choice', set_fields: { response_single_choice: 'ans_aaa' }.to_json }.to_json | ||
# pm_tt3.save! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why these are commented? If not relevant, can't you just delete them? |
||
sleep 2 | ||
es = $repository.find(pm.get_es_doc_id) | ||
pp es['task_responses'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please delete this debugging line if you don't need it. |
||
end | ||
end | ||
|
||
# Please add new tests to test/controllers/elastic_search_8_test.rb | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Only happens when the operation is "create"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes as create add a new object to nested_object