diff options
-rw-r--r-- | fatcat_scholar/search.py | 3 | ||||
-rw-r--r-- | settings.toml | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/fatcat_scholar/search.py b/fatcat_scholar/search.py index 121cb69..dccaf07 100644 --- a/fatcat_scholar/search.py +++ b/fatcat_scholar/search.py @@ -377,6 +377,9 @@ def do_fulltext_search( search = search.params(track_total_hits=True) search = search[offset : (offset + limit)] + if settings.ELASTICSEARCH_QUERY_PREFERENCE: + search = search.params(preference=settings.ELASTICSEARCH_QUERY_PREFERENCE) + query_start = datetime.datetime.now() try: resp = search.execute() diff --git a/settings.toml b/settings.toml index 76488b0..07ba1bd 100644 --- a/settings.toml +++ b/settings.toml @@ -5,6 +5,7 @@ SCHOLAR_ISSUEDB_PATH = "data/issue_db.sqlite" I18N_LANG_DEFAULT = "en" ELASTICSEARCH_QUERY_BASE = "http://localhost:9200" ELASTICSEARCH_QUERY_FULLTEXT_INDEX = "scholar_fulltext" +ELASTICSEARCH_QUERY_PREFERENCE = "" ELASTICSEARCH_WRITE_BASE = "http://localhost:9200" ELASTICSEARCH_WRITE_FULLTEXT_INDEX = "scholar_fulltext_v01" ELASTICSEARCH_PUBLIC_URL = "http://localhost:9292" @@ -65,6 +66,7 @@ SCHOLAR_ENV = "prod" ONION_DOMAIN = "scholar.archivev3qli37bju4rlh27glh24lljyezwxf4pokmrdbpefjlcrp5id.onion" ELASTICSEARCH_QUERY_BASE = "http://localhost:9292" ELASTICSEARCH_QUERY_FULLTEXT_INDEX = "scholar_fulltext" +ELASTICSEARCH_QUERY_PREFERENCE = "_local" ELASTICSEARCH_WRITE_BASE = "http://localhost:9200" ELASTICSEARCH_WRITE_FULLTEXT_INDEX = "scholar_fulltext_v01_20210128" ELASTICSEARCH_PUBLIC_URL = "https://search.fatcat.wiki" |