aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/search.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-05-20 21:05:50 -0700
committerBryan Newbold <bnewbold@archive.org>2020-05-20 21:05:50 -0700
commit686a188d79a6f152fcd3195db5847c710fb1231d (patch)
tree0c9c4b730c3f7741366e9c47ba934424be900adb /fatcat_scholar/search.py
parentfbaac5183383da6b5706f5178cfadf52f4bf7ddd (diff)
downloadfatcat-scholar-686a188d79a6f152fcd3195db5847c710fb1231d.tar.gz
fatcat-scholar-686a188d79a6f152fcd3195db5847c710fb1231d.zip
fewer, longer highlights (2x of 250 chars)
Diffstat (limited to 'fatcat_scholar/search.py')
-rw-r--r--fatcat_scholar/search.py8
1 files 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.<p><code>{}: {}</code>".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)