Commit 2e83524d authored by Valery Sizov's avatar Valery Sizov

[Elasticsearch] More efficient search

parent 8c5d328c
......@@ -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