From 89e9149b27263d6128be449c7b12b025cc031292 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 19 Jan 2021 00:55:44 -0800 Subject: 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. --- fatcat_scholar/web.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fatcat_scholar/web.py') 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) -- cgit v1.2.3