aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat/routes.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/fatcat/routes.py')
-rw-r--r--python/fatcat/routes.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/python/fatcat/routes.py b/python/fatcat/routes.py
index ad5faea6..7e52f651 100644
--- a/python/fatcat/routes.py
+++ b/python/fatcat/routes.py
@@ -312,6 +312,7 @@ def 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:
@@ -322,10 +323,10 @@ def search():
if 'q' in request.args.keys():
# always do files for HTML
- found = do_search(query, limit=limit)
- return render_template('release_search.html', found=found)
+ found = do_search(query, limit=limit, 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')
+ return render_template('release_search.html', query=query, fulltext_only=fulltext_only)
### Static Routes ###########################################################
@@ -342,6 +343,10 @@ def homepage():
def aboutpage():
return render_template('about.html')
+@app.route('/search', methods=['GET'])
+def search_redirect():
+ return redirect("/release/search")
+
@app.route('/robots.txt', methods=['GET'])
def robots():
return send_from_directory(os.path.join(app.root_path, 'static'),