add timeouts
authorFloatingGhost <hannah@coffee-and-dreams.uk>
Tue, 14 Dec 2021 14:33:34 +0000 (14:33 +0000)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Tue, 14 Dec 2021 14:35:46 +0000 (14:35 +0000)
lib/pleroma/search/elasticsearch.ex

index c897a2ace673beef9c5a7a74b0e02541573f6c98..00ae6b3dccacd4fc19b846f83092b9e426c4e307 100644 (file)
@@ -9,9 +9,9 @@ defmodule Pleroma.Search.Elasticsearch do
 
   defp es_query(:activity, query) do
     %{
-      size: 500,
-      terminate_after: 500,
-      timeout: "10s",
+      size: 50,
+      terminate_after: 50,
+      timeout: "5s",
       sort: [
         %{"_timestamp" => "desc"}
       ],
@@ -27,10 +27,7 @@ defmodule Pleroma.Search.Elasticsearch do
     %{
       size: 50,
       terminate_after: 50,
-      timeout: "10s",
-      sort: [
-        %{"_timestamp" => "desc"}
-      ],
+      timeout: "5s",
       query: %{
         bool: %{
           must: Parsers.User.parse(query)
@@ -43,7 +40,7 @@ defmodule Pleroma.Search.Elasticsearch do
     %{
       size: 50,
       terminate_after: 50,
-      timeout: "10s",
+      timeout: "5s",
       query: %{
         bool: %{
           must: Parsers.Hashtag.parse(query)