Commit acc333bf authored by Sean McGivern's avatar Sean McGivern

Merge branch 'es_filter_scope_for_iid_search' into 'master'

[Elasticsearch] More efficient search

See merge request !1282
parents b705d410 2e83524d
......@@ -141,7 +141,7 @@ module Elastic
{
query: {
bool: {
must: [{ term: { iid: iid } }]
filter: [{ term: { iid: iid } }]
}
}
}
......@@ -155,7 +155,8 @@ module Elastic
options[:public_and_internal_projects]
)
query_hash[:query][:bool][:filter] = {
query_hash[:query][:bool][:filter] ||= []
query_hash[:query][:bool][:filter] << {
has_parent: {
parent_type: "project",
query: {
......
......@@ -79,7 +79,7 @@ module Elastic
{ term: { confidential: false } }
end
query_hash[:query][:bool][:must] << filter
query_hash[:query][:bool][:filter] << filter
query_hash
end
end
......
---
title: "[Elasticsearch] More efficient search"
merge_request:
author:
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