Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'Query' object has no attribute 'msearch' #60

Open
judzero opened this issue Dec 13, 2023 · 1 comment
Open

AttributeError: 'Query' object has no attribute 'msearch' #60

judzero opened this issue Dec 13, 2023 · 1 comment

Comments

@judzero
Copy link

judzero commented Dec 13, 2023

Im trying to use msearch for an ecommerce website
I have followed everything and tried every possible code that i have read on README

@app.route('/result')
def result():
    searchword = request.form.get('q')
    products = Addproduct.query.msearch(searchword, fields=['name']).all()
    return render_template('products/result.html',products=products)

the application runs when this code
search = Search()
but when you put the "app" in either

search = Search()
search.init_app(app)

it shows many errors
Please Help

@honmaple
Copy link
Owner

Please show more info. If you do not use flask_sqlalchemy's db.Model as the base class of Addproduct, this error is expected. #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants