Commit 5e816cea authored by Dylan Griffith's avatar Dylan Griffith

Merge branch '207355-es-add-snippet-desc' into 'master'

Elasticsearch index snippet description

See merge request gitlab-org/gitlab!26870
parents e1ba28cb 028b12a1
---
title: Include snippet description as part of snippet title search (when Elasticsearch is not enabled)
title: Include snippet description as part of snippet title search (basic search).
merge_request: 25961
author:
type: added
---
title: Include snippet description as part of snippet title search (advanced search, Elasticsearch reindexing required).
merge_request: 26870
author:
type: added
......@@ -4,7 +4,7 @@ module Elastic
module Latest
class SnippetClassProxy < ApplicationClassProxy
def elastic_search(query, options: {})
query_hash = basic_query_hash(%w(title file_name), query)
query_hash = basic_query_hash(%w(title description file_name), query)
query_hash = filter(query_hash, options)
search(query_hash, options)
......
......@@ -15,6 +15,7 @@ module Elastic
:title,
:file_name,
:content,
:description,
:created_at,
:updated_at,
:project_id,
......
......@@ -13,6 +13,7 @@ describe Elastic::Latest::SnippetInstanceProxy do
id: snippet.id,
title: snippet.title,
file_name: snippet.file_name,
description: snippet.description,
content: snippet.content,
created_at: snippet.created_at,
updated_at: snippet.updated_at,
......
......@@ -131,6 +131,7 @@ describe Snippet, :elastic do
'file_name',
'content',
'created_at',
'description',
'updated_at',
'state',
'project_id',
......
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