summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/routes.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-02-20 19:58:29 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-02-20 19:58:29 -0800
commit46e67e77cf7709dae7375a22a6fed1ac730355bf (patch)
treeea8ae53d57d3dc2e9cb2c6c0efa5359ef9f8d773 /python/fatcat_web/routes.py
parent7c04b83a6612b7a0c87afe4a1ed4bbb65568fea1 (diff)
downloadfatcat-46e67e77cf7709dae7375a22a6fed1ac730355bf.tar.gz
fatcat-46e67e77cf7709dae7375a22a6fed1ac730355bf.zip
refactor entity searches
Diffstat (limited to 'python/fatcat_web/routes.py')
-rw-r--r--python/fatcat_web/routes.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py
index 7f10ee2b..115c1981 100644
--- a/python/fatcat_web/routes.py
+++ b/python/fatcat_web/routes.py
@@ -353,18 +353,12 @@ def changelog_entry_view(index):
@app.route('/release/search', methods=['GET', 'POST'])
def release_search():
- limit = 20
query = request.args.get('q')
fulltext_only = bool(request.args.get('fulltext_only'))
- # Convert raw DOIs to DOI queries
- if query is not None:
- if len(query.split()) == 1 and query.startswith("10.") and query.count("/") >= 1:
- query = 'doi:"{}"'.format(query)
-
if 'q' in request.args.keys():
# always do files for HTML
- found = do_release_search(query, limit=limit, fulltext_only=fulltext_only)
+ found = do_release_search(query, fulltext_only=fulltext_only)
return render_template('release_search.html', found=found, query=query, fulltext_only=fulltext_only)
else:
return render_template('release_search.html', query=query, fulltext_only=fulltext_only)
@@ -372,17 +366,11 @@ def release_search():
@app.route('/container/search', methods=['GET', 'POST'])
def container_search():
- limit = 20
query = request.args.get('q')
- # Convert raw ISSN-L to ISSN-L query
- if query is not None:
- if len(query.split()) == 1 and len(query) == 9 and isdigit(query[0:4]) and query[4] == '-':
- query = 'issnl:"{}"'.format(query)
-
if 'q' in request.args.keys():
# always do files for HTML
- found = do_container_search(query, limit=limit)
+ found = do_container_search(query)
return render_template('container_search.html', found=found, query=query)
else:
return render_template('container_search.html', query=query)