Открыть боковую панель
Захаров Дмитрий Сергеевич
Gitlab
Коммиты
64f5e663
Коммит
64f5e663
создал
Мар 21, 2016
по автору
Rémy Coutable
Просмотр файлов
Fix an issue with wiki in search results when using ES
владелец
fd82245b
Изменения
1
Скрыть пробелы
Построчно
Рядом
app/models/repository.rb
Просмотр файла @
64f5e663
...
@@ -880,6 +880,8 @@ def parse_search_result(result)
...
@@ -880,6 +880,8 @@ def parse_search_result(result)
def
parse_search_result_from_elastic
(
result
)
def
parse_search_result_from_elastic
(
result
)
ref
=
result
[
"_source"
][
"blob"
][
"commit_sha"
]
ref
=
result
[
"_source"
][
"blob"
][
"commit_sha"
]
filename
=
result
[
"_source"
][
"blob"
][
"path"
]
filename
=
result
[
"_source"
][
"blob"
][
"path"
]
extname
=
File
.
extname
(
filename
)
basename
=
filename
.
sub
(
/
#{
extname
}
$/
,
''
)
content
=
result
[
"_source"
][
"blob"
][
"content"
]
content
=
result
[
"_source"
][
"blob"
][
"content"
]
total_lines
=
content
.
lines
.
size
total_lines
=
content
.
lines
.
size
...
@@ -909,6 +911,7 @@ def parse_search_result_from_elastic(result)
...
@@ -909,6 +911,7 @@ def parse_search_result_from_elastic(result)
OpenStruct
.
new
(
OpenStruct
.
new
(
filename:
filename
,
filename:
filename
,
basename:
basename
,
ref:
ref
,
ref:
ref
,
startline:
from
+
1
,
startline:
from
+
1
,
data:
data
.
join
data:
data
.
join
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать