From bed6f4e12cc7ff259db3e515243e1275733c389b Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Tue, 14 Dec 2021 14:33:34 +0000 Subject: [PATCH] add timeouts --- lib/pleroma/search/elasticsearch.ex | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/pleroma/search/elasticsearch.ex b/lib/pleroma/search/elasticsearch.ex index e770fe536..00ae6b3dc 100644 --- a/lib/pleroma/search/elasticsearch.ex +++ b/lib/pleroma/search/elasticsearch.ex @@ -9,6 +9,12 @@ defmodule Pleroma.Search.Elasticsearch do defp es_query(:activity, query) do %{ + size: 50, + terminate_after: 50, + timeout: "5s", + sort: [ + %{"_timestamp" => "desc"} + ], query: %{ bool: %{ must: Parsers.Activity.parse(query) @@ -19,6 +25,9 @@ defmodule Pleroma.Search.Elasticsearch do defp es_query(:user, query) do %{ + size: 50, + terminate_after: 50, + timeout: "5s", query: %{ bool: %{ must: Parsers.User.parse(query) @@ -29,6 +38,9 @@ defmodule Pleroma.Search.Elasticsearch do defp es_query(:hashtag, query) do %{ + size: 50, + terminate_after: 50, + timeout: "5s", query: %{ bool: %{ must: Parsers.Hashtag.parse(query) -- 2.45.2