aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/web.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-01-19 00:55:44 -0800
committerBryan Newbold <bnewbold@archive.org>2021-01-19 19:49:04 -0800
commit89e9149b27263d6128be449c7b12b025cc031292 (patch)
treee3233ac5fc462881353be62c45217e9a4d974d4f /fatcat_scholar/web.py
parent59cc64a24e4331899e6b952cc7a8dedc1ec13547 (diff)
downloadfatcat-scholar-89e9149b27263d6128be449c7b12b025cc031292.tar.gz
fatcat-scholar-89e9149b27263d6128be449c7b12b025cc031292.zip
add citation query feature (disabled by default)
This is operationally complex (queries hit 3x backend services!), so not enabled by default. Will need more testing; possibly circuit-breaking. Though haproxy should provide some of that automatically at this point.
Diffstat (limited to 'fatcat_scholar/web.py')
-rw-r--r--fatcat_scholar/web.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/fatcat_scholar/web.py b/fatcat_scholar/web.py
index a54b4e4..133ddce 100644
--- a/fatcat_scholar/web.py
+++ b/fatcat_scholar/web.py
@@ -19,7 +19,7 @@ from starlette.exceptions import HTTPException as StarletteHTTPException
from fatcat_scholar.config import settings, GIT_REVISION
from fatcat_scholar.hacks import Jinja2Templates, parse_accept_lang
-from fatcat_scholar.search import do_fulltext_search, FulltextQuery, FulltextHits
+from fatcat_scholar.search import process_query, FulltextQuery, FulltextHits
from fatcat_scholar.schema import ScholarDoc
@@ -97,7 +97,7 @@ class HitsModel(BaseModel):
async def search(query: FulltextQuery = Depends(FulltextQuery)) -> FulltextHits:
hits: Optional[FulltextHits] = None
try:
- hits = do_fulltext_search(query)
+ hits = process_query(query)
except ValueError as e:
sentry_sdk.set_level("warning")
sentry_sdk.capture_exception(e)
@@ -213,7 +213,7 @@ async def web_search(
status_code: int = 200
if query.q is not None:
try:
- hits = do_fulltext_search(query)
+ hits = process_query(query)
except ValueError as e:
sentry_sdk.set_level("warning")
sentry_sdk.capture_exception(e)