From 6e1e4ec6ea74ee76b259ad99de68649a25d122ef Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 3 Jun 2020 14:09:38 -0700 Subject: change availability filter phrasing; default to fulltext --- fatcat_scholar/search.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fatcat_scholar') diff --git a/fatcat_scholar/search.py b/fatcat_scholar/search.py index d899711..76a2f70 100644 --- a/fatcat_scholar/search.py +++ b/fatcat_scholar/search.py @@ -51,10 +51,10 @@ class FulltextQuery(BaseModel): availability_options: Any = { "label": gettext("Availability"), "slug": "filter_availability", - "default": "everything", + "default": "fulltext", "list": [ - {"label": gettext("Everything"), "slug": "everything"}, {"label": gettext("Fulltext"), "slug": "fulltext"}, + {"label": gettext("Metadata"), "slug": "everything"}, {"label": gettext("Open Access"), "slug": "oa"}, ], } @@ -124,11 +124,11 @@ def do_fulltext_search(query: FulltextQuery, deep_page_limit: int = 2000) -> Ful # availability filters if query.filter_availability == "oa": # TODO: real OA filter/flag - search = search.filter("exists", field="license_slug") - elif query.filter_availability == "fulltext": - search = search.filter("terms", access_type=["wayback", "ia_file", "ia_sim"]) - elif query.filter_availability == "everything" or query.filter_availability == None: + search = search.filter("term", tag="OA") + elif query.filter_availability == "everything": pass + elif query.filter_availability == "fulltext" or query.filter_availability == None: + search = search.filter("terms", access_type=["wayback", "ia_file", "ia_sim"]) else: raise ValueError(f"Unknown 'filter_availability' parameter value: '{query.filter_availability}'") -- cgit v1.2.3