|
|
|
@ -524,6 +524,9 @@ def search_results(searchtype, query, viewby):
|
|
|
|
|
|
|
|
|
|
if searchtype== 'Stack':
|
|
|
|
|
results=db.session.query(Book).join(Book.stacks).filter(Stack.stack_name.contains(query)).order_by(Book.title)
|
|
|
|
|
|
|
|
|
|
if searchtype== 'Outliers':
|
|
|
|
|
results=Book.query.filter(Book.sameness > 50).order_by(Book.title)
|
|
|
|
|
|
|
|
|
|
if searchtype== 'All':
|
|
|
|
|
# results=Book.query.whoosh_search(query)
|
|
|
|
@ -531,8 +534,7 @@ def search_results(searchtype, query, viewby):
|
|
|
|
|
results=results.union(Book.query.filter(Book.category.contains(query)))
|
|
|
|
|
results=results.union(Book.query.filter(Book.year_published.contains(query)))
|
|
|
|
|
results=results.union(db.session.query(Book).join(Book.authors).filter(Author.author_name.contains(query)))
|
|
|
|
|
results=results.union(db.session.query(Book).join(Book.stacks).filter(Stack.stack_name.contains(query)))
|
|
|
|
|
results=results.union(db.session.query(Book).join(Book.stacks).filter(Stack.stack_description.contains(query))).order_by(Book.title)
|
|
|
|
|
results=results.union(db.session.query(Book).join(Book.stacks).filter(Stack.stack_name.contains(query))).order_by(Book.title)
|
|
|
|
|
|
|
|
|
|
if results.count() == 0:
|
|
|
|
|
books = Book.query.filter(Book.file.like('potential.pdf'))
|
|
|
|
|