How to Add Full Text Search to Your SQLAlchemy Data Model in Flask Using Flask-WhooshAlchemy

Поділитися
Вставка
  • Опубліковано 6 вер 2024

КОМЕНТАРІ • 66

  • @prettyprinted
    @prettyprinted  4 роки тому +2

    Join my free course on the basics of Flask-SQLAlchemy: prettyprinted.com/flasksql

  • @MrEdgar7211
    @MrEdgar7211 4 роки тому +2

    You have the best Flask videos! I have taken advantage of your free videos for about a year. You are amazing!! Greetings from Cartagena, Colombia.

  • @gurucode.studio
    @gurucode.studio 8 років тому +1

    The best video tutorial that describe whoosh_search on the whole internet, i did exact the same steps but with a few changes and every thing works just great ;), thanks dude .

  • @nekoreid151
    @nekoreid151 5 років тому +2

    Thank you for this great tutorial. You made it soo easy to understand.

    • @prettyprinted
      @prettyprinted  5 років тому

      You're welcome! Thanks for watching.

  • @adityatile1168
    @adityatile1168 5 років тому +2

    Hey, I did exactly as instructed, but got an error when I imported flask_whooshalchemy, on searching on google it seems that it has been deprecated :
    ModuleNotFoundError: No module named 'flask.ext'

    • @prettyprinted
      @prettyprinted  5 років тому +2

      I have to make an updated video for this because of changes to the library.

  • @kumodkumaryadavkkr8677
    @kumodkumaryadavkkr8677 5 років тому +2

    I NEED A BLOG WHERE I CAN SEARCH THE LIST OF STUDENTS AND CAN SEE THEIR WORK OR PROJECTS OR ANY FILE THEY HAD UPLOADED PLZ HELP

  • @newton0232
    @newton0232 2 роки тому

    How are u able to use phpMyAdmin to view the model tables?

  • @shuvadipghosh374
    @shuvadipghosh374 3 роки тому

    Sir what is the process of doing it in sqlite database

  • @josephbritton9516
    @josephbritton9516 4 роки тому

    How do you index child items from foreign key related tables? e.g. If you had one table listing 'movies', and a child table with 'movie_categories', how do you index the categories into the same index as movies so that users can search by category?

  • @sumanshu.nankana
    @sumanshu.nankana 4 роки тому

    Hello Sir,
    I am not sure; why I am getting this error.
    wa.whoosh_index(app,Course)
    AttributeError: module 'flask_whooshalchemy' has no attribute 'whoosh_index'

  • @LinkstaRuViews
    @LinkstaRuViews 4 роки тому

    This don't work on Python 3. No .search_index, no update search request. Where new video with update info?

  • @inovexa4039
    @inovexa4039 3 роки тому +1

    For those who are using python three use flask_whooshalchemyplus

  • @nah0221
    @nah0221 2 роки тому

    Hello from 2022. Flask_whooshalchemy is no longer supported and does not work with python 3.0+.

  • @abarrachina
    @abarrachina 6 років тому +2

    It's just me Anthony or your voice changes from video to video? haha nice videos though. Very helpfull

    • @prettyprinted
      @prettyprinted  6 років тому

      Different microphones! Thanks for watching enough of my videos to hear the difference.

  • @ShahidKhan-sd7lv
    @ShahidKhan-sd7lv 3 роки тому

    please help me with solving this error AttributeError: module 'flask_whooshalchemy' has no attribute 'whoosh_index'

  • @Insertcns
    @Insertcns 3 роки тому

    Thanks for the tutorial! Sadly, I get an error ModuleNotFoundError: No module named 'flask.ext' when I try to import flask sqlalchemy (tried from flask_sqlalchemy import SQLAlchemy and from flask.ext.sqlalchemy import SQLAlchemy), python version 3.9

    • @SAM-ub9su
      @SAM-ub9su 3 роки тому

      What db are you using,,, flask.ext doesn't work for all lib....you need to understand how your db works..

  • @darpanjain
    @darpanjain 4 роки тому

    Quite helpful

  • @abdelhafiddahhani2514
    @abdelhafiddahhani2514 6 років тому

    Hi Mr Anthony
    Firstly thank you very much for all this videos, actually I have benefited Them, but i have a question : is woosh professionnal to use it in our application !! or not ?

    • @prettyprinted
      @prettyprinted  6 років тому

      If it fits your use case and you're comfortable with it, then it is professional enough.

  • @kun2424
    @kun2424 7 років тому

    Can I deploy whoosh_search to existing database? I see you added data after applying whoosh, so whoosh knows what is being added into your database. What if I already have data?

    • @prettyprinted
      @prettyprinted  7 років тому

      You can, but you'll have to make sure the data gets indexed:
      Try this StackOverflow answer: stackoverflow.com/questions/23472161/how-flask-whooshalchemy-index-data-imported-manually

  • @sauravgsh16
    @sauravgsh16 7 років тому

    Hi , Awesome video. Is there a way to search multiple key word from a single query?

    • @prettyprinted
      @prettyprinted  7 років тому

      Multiple keywords should work. Have you run into a specific problem?

  • @peterpeter8212
    @peterpeter8212 4 роки тому

    This library is over
    .
    Source:
    github.com/gyllstromk/Flask-WhooshAlchemy/issues/69
    Alternative Library
    :
    github.com/honmaple/flask-msearch

    • @drac8854
      @drac8854 3 роки тому

      is there any other library?

  • @pial2461
    @pial2461 6 років тому

    AttributeError: 'BaseQuery' object has no attribute 'whoosh_search'......i was googling on this topic but unable to find anything that can solve my issue.Please help Anthony

    • @prettyprinted
      @prettyprinted  6 років тому

      Did you add the whoosh index?

    • @pial2461
      @pial2461 6 років тому

      @@prettyprinted oh no!.But how to add that anthony?. Please help

    • @prettyprinted
      @prettyprinted  5 років тому

      It's in the video.

  • @nesteaa6433
    @nesteaa6433 7 років тому

    Hi, thank you for the video! Unfortunately I'm having a problem committing to the database. I get this error:
    sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) can't adapt type 'builtin_function_or_method' [SQL: 'INSERT INTO "Test" (id, name) VALUES (%(id)s, %(name)s)'] [parameters: {'id': , 'name': 'Nestor'}]
    There's seems to be something wrong with my "id" variable, and I don't quite understand where the type "builtin_function_or_method" is coming from. I read somewhere that flask_whooshalchemy wasn't completely compatible with Python3 (which is what I am using) at some point. Could this be the issue?
    Note: my model is named Test and only has two variables, id and name. Also it is only searchable by name. Everything else is pretty much the same as your example. Oh and my whoosh folder is named "whoosh_indexes" and not "whoosh", it seems like it was created on its own after installing the extension.

  • @julianoresende
    @julianoresende 6 років тому

    Do you know if exist a alternative to Python 3, I read some blog posts about Whoosh and perhaps doesn't work. Thanks a lot your videos are very nice.

    • @prettyprinted
      @prettyprinted  6 років тому

      I'd have to do some research to find an alternative.

  • @akirafudo5268
    @akirafudo5268 5 років тому +1

    Good video, but Flask-Whooshalchemy only works with Python 2.7, which is something you should have really stated from the beginning.

  • @CambiyaJesh
    @CambiyaJesh 5 років тому

    Is this still available for flask? I'm getting import error and if so what's another alternative?

    • @prettyprinted
      @prettyprinted  5 років тому

      There have been issues with the library. I plan to look into it to see if it can be fixed.

    • @CambiyaJesh
      @CambiyaJesh 5 років тому

      @@prettyprinted Thank you for replying. However I've found Fork for it in Flask mega tutorial. Thanks though

  • @vatsalaykhobragade
    @vatsalaykhobragade 5 років тому

    hey, i get this error when i run my app: ModuleNotFoundError: '' no module named flask.ext '' Please help !!

    • @prettyprinted
      @prettyprinted  5 років тому

      What line of code does the error occur on?

    • @vatsalaykhobragade
      @vatsalaykhobragade 5 років тому

      @@prettyprinted import flask_whooshalchemy as wa

    • @prettyprinted
      @prettyprinted  5 років тому

      @@vatsalaykhobragade I'm not sure what's going on then. When I get a chance I'll have to try using flask_whooshalchemy again. It's been a couple of years since I last used it.

    • @vatsalaykhobragade
      @vatsalaykhobragade 5 років тому

      @@prettyprinted Ok. make a video on flask whooshalchemy as soon as possible (:

    • @lardosian
      @lardosian 5 років тому

      @@vatsalaykhobragade Seems to be a problem with python 3.

  • @drac8854
    @drac8854 3 роки тому

    this isn't working anymore

  • @mxd8
    @mxd8 5 років тому

    Bro please do search with elasticsearch! :)

    • @prettyprinted
      @prettyprinted  5 років тому +1

      I'll definitely cover that eventually.

  • @vatsalaykhobragade
    @vatsalaykhobragade 5 років тому

    please give us the code .

  • @vtvvnha2230
    @vtvvnha2230 7 років тому

    how to use with python3.6

    • @prettyprinted
      @prettyprinted  6 років тому

      It should be the same as it is here. Are you running into any particular issues?

    • @vtvvnha2230
      @vtvvnha2230 6 років тому

      i got issue AttributeError: 'BaseQuery' object has no attribute 'whoosh_search'
      I use sqlite as database

    • @prettyprinted
      @prettyprinted  6 років тому

      Send your code to anthony@prettyprinted.com I can help you more over email.

    • @tojtowny
      @tojtowny 6 років тому

      It seems like the package has some bits left with syntax from python2 (specifically unicode and iteritems), after correcting that the search works. but it bit pain in deployment.
      Do you know any workaround on this?