July 2019
Beginner to intermediate
302 pages
9h 38m
English
Integrating Whoosh with Flask using SQLAlchemy is pretty straightforward. Let's take a look:
app.config['WHOOSH_BASE'] = '/tmp/whoosh'
You can choose any path you prefer, and it can be absolute or relative.
import flask_whooshalchemy from my_app import app class Product(db.Model): __searchable__ = ['name', 'company'] # ... Rest of code as before ... # class Category(db.Model): __searchable__ = ['name'] # ... Rest of code as before ... ...