Skip to content
Snippets Groups Projects
Commit e3b5b46c authored by Valery Sizov's avatar Valery Sizov
Browse files

Fix Elasticsearch::Transport::Transport::Errors::BadRequest

parent cea77efe
No related branches found
No related tags found
No related merge requests found
Please view this file on the master branch, on stable branches it's out of date.
 
## 8.13.1
- Fix Elasticsearch::Transport::Transport::Errors::BadRequest when ES is enabled. #21036
## 8.13.0 (2016-10-22)
 
- Cache the last usage data to avoid unicorn timeouts
Loading
Loading
class DiffNote < Note
# Elastic search configuration (it does not support STI properly)
document_type 'note'
index_name [Rails.application.class.parent_name.downcase, Rails.env].join('-')
include Elastic::NotesSearch
include NoteOnDiff
 
serialize :original_position, Gitlab::Diff::Position
Loading
Loading
class LegacyDiffNote < Note
# Elastic search configuration (it does not support STI properly)
document_type 'note'
index_name [Rails.application.class.parent_name.downcase, Rails.env].join('-')
include Elastic::NotesSearch
include NoteOnDiff
 
serialize :st_diff
Loading
Loading
Loading
Loading
@@ -29,6 +29,24 @@ describe Note, elastic: true do
expect(described_class.elastic_search('term', options: options).total_count).to eq(1)
end
 
it "indexes && searches diff notes" do
notes = []
Sidekiq::Testing.inline! do
notes << create(:diff_note_on_merge_request, note: "term")
notes << create(:diff_note_on_commit, note: "term")
notes << create(:legacy_diff_note_on_merge_request, note: "term")
notes << create(:legacy_diff_note_on_commit, note: "term")
Gitlab::Elastic::Helper.refresh_index
end
project_ids = notes.map { |note| note.noteable.project.id }
options = { project_ids: project_ids }
expect(described_class.elastic_search('term', options: options).total_count).to eq(4)
end
it "returns json with all needed elements" do
note = create :note
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment