aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fatcat_scholar/search.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/fatcat_scholar/search.py b/fatcat_scholar/search.py
index 891abff..c362ea6 100644
--- a/fatcat_scholar/search.py
+++ b/fatcat_scholar/search.py
@@ -87,13 +87,14 @@ class FulltextHits(BaseModel):
results: List[Any]
+# global sync client connection
+es_client = elasticsearch.Elasticsearch(settings.ELASTICSEARCH_BACKEND, timeout=25.0)
+
+
def do_fulltext_search(
query: FulltextQuery, deep_page_limit: int = 2000
) -> FulltextHits:
- es_client = elasticsearch.Elasticsearch(
- settings.ELASTICSEARCH_BACKEND, timeout=25.0
- )
search = Search(using=es_client, index=settings.ELASTICSEARCH_FULLTEXT_INDEX)
# Convert raw DOIs to DOI queries