Commit 5fcaad9d authored by Robert Speicher's avatar Robert Speicher

Merge branch 'fix/396-master' into 'master'

Fix an issue with wiki in search results when using ES

These changes are a port of gitlab-org/gitlab-ce!3138 to EE for Elastisearch.

This can be safely merged before the next CE->EE `master` merge.

Fixes #396.

See merge request !286
parents 9b80d894 c0126681
......@@ -861,6 +861,8 @@ class Repository
def parse_search_result_from_elastic(result)
ref = result["_source"]["blob"]["commit_sha"]
filename = result["_source"]["blob"]["path"]
extname = File.extname(filename)
basename = filename.sub(/#{extname}$/, '')
content = result["_source"]["blob"]["content"]
total_lines = content.lines.size
......@@ -890,6 +892,7 @@ class Repository
OpenStruct.new(
filename: filename,
basename: basename,
ref: ref,
startline: from + 1,
data: data.join
......
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