Commit 558ddfbb authored by Valery Sizov's avatar Valery Sizov

ES: fix for imported project

parent 9223e824
...@@ -260,6 +260,11 @@ class Project < ActiveRecord::Base ...@@ -260,6 +260,11 @@ class Project < ActiveRecord::Base
project.mirror_last_successful_update_at = timestamp project.mirror_last_successful_update_at = timestamp
project.save project.save
end end
if Gitlab.config.elasticsearch.enabled
project.repository.index_blobs
project.repository.index_commits
end
end end
after_transition started: :failed do |project, transaction| after_transition started: :failed do |project, transaction|
......
...@@ -680,7 +680,7 @@ class Repository ...@@ -680,7 +680,7 @@ class Repository
content = result["_source"]["blob"]["content"] content = result["_source"]["blob"]["content"]
total_lines = content.lines.size total_lines = content.lines.size
term = result["highlight"]["blob.content"][0].match(/gitlabelasticsearch→(.*)←gitlabelasticsearch/)[1] term = result["highlight"]["blob.content"][0].match(/gitlabelasticsearch→(.*?)←gitlabelasticsearch/)[1]
found_line_number = 0 found_line_number = 0
content.each_line.each_with_index do |line, index| content.each_line.each_with_index do |line, index|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment