From 686a188d79a6f152fcd3195db5847c710fb1231d Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 20 May 2020 21:05:50 -0700 Subject: fewer, longer highlights (2x of 250 chars) --- fatcat_scholar/search.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fatcat_scholar/search.py b/fatcat_scholar/search.py index b816c5b..f94c403 100644 --- a/fatcat_scholar/search.py +++ b/fatcat_scholar/search.py @@ -31,12 +31,12 @@ def generic_search_execute(search, limit=25, offset=0, deep_page_limit=2000): print("elasticsearch 400: " + str(e.info)) #flash("Search query failed to parse; you might need to use quotes.

{}: {}".format(e.error, e.info['error']['root_cause'][0]['reason'])) # XXX: abort(e.status_code) - raise Exception() + raise e except elasticsearch.exceptions.TransportError as e: # all other errors print("elasticsearch non-200 status code: {}".format(e.info)) # XXX: abort(e.status_code) - raise Exception() + raise e # convert from objects to python dicts results = [] @@ -123,8 +123,8 @@ def do_fulltext_search(q, limit=25, offset=0, filter_time=None, filter_type=None "abstracts_all", "fulltext.body", "fulltext.annex", - number_of_fragments=3, - fragment_size=150, + number_of_fragments=2, + fragment_size=250, ) resp = generic_search_execute(search, offset=offset) -- cgit v1.2.3