forked from AkkomaGang/akkoma
add timeouts
This commit is contained in:
parent
9d5d964bf8
commit
bed6f4e12c
1 changed files with 12 additions and 0 deletions
|
@ -9,6 +9,12 @@ defmodule Pleroma.Search.Elasticsearch do
|
||||||
|
|
||||||
defp es_query(:activity, query) do
|
defp es_query(:activity, query) do
|
||||||
%{
|
%{
|
||||||
|
size: 50,
|
||||||
|
terminate_after: 50,
|
||||||
|
timeout: "5s",
|
||||||
|
sort: [
|
||||||
|
%{"_timestamp" => "desc"}
|
||||||
|
],
|
||||||
query: %{
|
query: %{
|
||||||
bool: %{
|
bool: %{
|
||||||
must: Parsers.Activity.parse(query)
|
must: Parsers.Activity.parse(query)
|
||||||
|
@ -19,6 +25,9 @@ defp es_query(:activity, query) do
|
||||||
|
|
||||||
defp es_query(:user, query) do
|
defp es_query(:user, query) do
|
||||||
%{
|
%{
|
||||||
|
size: 50,
|
||||||
|
terminate_after: 50,
|
||||||
|
timeout: "5s",
|
||||||
query: %{
|
query: %{
|
||||||
bool: %{
|
bool: %{
|
||||||
must: Parsers.User.parse(query)
|
must: Parsers.User.parse(query)
|
||||||
|
@ -29,6 +38,9 @@ defp es_query(:user, query) do
|
||||||
|
|
||||||
defp es_query(:hashtag, query) do
|
defp es_query(:hashtag, query) do
|
||||||
%{
|
%{
|
||||||
|
size: 50,
|
||||||
|
terminate_after: 50,
|
||||||
|
timeout: "5s",
|
||||||
query: %{
|
query: %{
|
||||||
bool: %{
|
bool: %{
|
||||||
must: Parsers.Hashtag.parse(query)
|
must: Parsers.Hashtag.parse(query)
|
||||||
|
|
Loading…
Reference in a new issue