Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3a268fb7
Commit
3a268fb7
authored
May 15, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Elasticsearch searches through the project description
parent
efb3f52f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
app/models/concerns/elastic/projects_search.rb
app/models/concerns/elastic/projects_search.rb
+1
-1
changelogs/unreleased-ee/es_search_though_the_project_description.yml
...nreleased-ee/es_search_though_the_project_description.yml
+4
-0
spec/models/concerns/elastic/project_spec.rb
spec/models/concerns/elastic/project_spec.rb
+2
-1
No files found.
app/models/concerns/elastic/projects_search.rb
View file @
3a268fb7
...
...
@@ -72,7 +72,7 @@ module Elastic
end
def
self
.
elastic_search
(
query
,
options:
{})
options
[
:in
]
=
%w(name^10 name_with_namespace^2 path_with_namespace path^9)
options
[
:in
]
=
%w(name^10 name_with_namespace^2 path_with_namespace path^9
description
)
query_hash
=
basic_query_hash
(
options
[
:in
],
query
)
...
...
changelogs/unreleased-ee/es_search_though_the_project_description.yml
0 → 100644
View file @
3a268fb7
---
title
:
Elasticsearch searches through the project description
merge_request
:
author
:
spec/models/concerns/elastic/project_spec.rb
View file @
3a268fb7
...
...
@@ -16,7 +16,7 @@ describe Project, elastic: true do
Sidekiq
::
Testing
.
inline!
do
project
=
create
:empty_project
,
name:
'test1'
project1
=
create
:empty_project
,
path:
'test2'
project1
=
create
:empty_project
,
path:
'test2'
,
description:
'awesome project'
project2
=
create
:empty_project
create
:empty_project
,
path:
'someone_elses_project'
project_ids
+=
[
project
.
id
,
project1
.
id
,
project2
.
id
]
...
...
@@ -26,6 +26,7 @@ describe Project, elastic: true do
expect
(
described_class
.
elastic_search
(
'test1'
,
options:
{
project_ids:
project_ids
}).
total_count
).
to
eq
(
1
)
expect
(
described_class
.
elastic_search
(
'test2'
,
options:
{
project_ids:
project_ids
}).
total_count
).
to
eq
(
1
)
expect
(
described_class
.
elastic_search
(
'awesome'
,
options:
{
project_ids:
project_ids
}).
total_count
).
to
eq
(
1
)
expect
(
described_class
.
elastic_search
(
'test*'
,
options:
{
project_ids:
project_ids
}).
total_count
).
to
eq
(
2
)
expect
(
described_class
.
elastic_search
(
'someone_elses_project'
,
options:
{
project_ids:
project_ids
}).
total_count
).
to
eq
(
0
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment