diff options
Diffstat (limited to 'fatcat_scholar/search.py')
-rw-r--r-- | fatcat_scholar/search.py | 12 |
1 files changed, 6 insertions, 6 deletions
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}'") |