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
a02bbc78
Commit
a02bbc78
authored
Feb 16, 2021
by
Dmitry Gruzd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Advanced Search: fix project count_only queries
parent
7d25a6e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
ee/changelogs/unreleased/321620-fix-project-count-only-queries.yml
...logs/unreleased/321620-fix-project-count-only-queries.yml
+5
-0
ee/lib/elastic/latest/project_class_proxy.rb
ee/lib/elastic/latest/project_class_proxy.rb
+1
-1
ee/spec/lib/gitlab/elastic/search_results_spec.rb
ee/spec/lib/gitlab/elastic/search_results_spec.rb
+10
-0
No files found.
ee/changelogs/unreleased/321620-fix-project-count-only-queries.yml
0 → 100644
View file @
a02bbc78
---
title
:
'
Advanced
Search:
fix
project
count_only
queries'
merge_request
:
54303
author
:
type
:
fixed
ee/lib/elastic/latest/project_class_proxy.rb
View file @
a02bbc78
...
...
@@ -44,7 +44,7 @@ module Elastic
}
end
query_hash
[
:query
][
:bool
][
:filter
]
=
filters
query_hash
[
:query
][
:bool
][
:filter
]
+
=
filters
end
search
(
query_hash
,
options
)
...
...
ee/spec/lib/gitlab/elastic/search_results_spec.rb
View file @
a02bbc78
...
...
@@ -1269,6 +1269,16 @@ RSpec.describe Gitlab::Elastic::SearchResults, :elastic, :sidekiq_might_not_need
expect
(
projects
).
to
include
public_project
expect
(
results
.
projects_count
).
to
eq
1
end
it
'returns 0 results for count only query'
do
public_project
ensure_elasticsearch_index!
results
=
described_class
.
new
(
user
,
'noresults'
)
count
=
results
.
formatted_count
(
'projects'
)
expect
(
count
).
to
eq
(
'0'
)
end
end
context
'merge requests'
do
...
...
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