Full Text Search in .NET With PostgreSQL and EF Core

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 90

  • @MilanJovanovicTech
    @MilanJovanovicTech  Месяц назад +1

    Want to master Clean Architecture? Go here: bit.ly/3PupkOJ
    Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt
    Join a community of 1000+ .NET developers: www.patreon.com/milanjovanovic

  • @markovuckovic938
    @markovuckovic938 Месяц назад +2

    Thanks a lot Milan for this useful information. I haven't had any hands on experience with Postgres GIN indexes so far and this made me motivated to dive deep into the research.

  • @nikolaluburic
    @nikolaluburic Месяц назад +1

    Awesome video. Postgres is incredibly powerful, and it seems to satisfy a lot of use cases for typical software solutions.

  • @aminejadid2702
    @aminejadid2702 3 часа назад

    Hello, Great Video ! What about partial matching ? This full text search functionality works with full word matching strings not partial strings. Any idea how we could achieve that ?

  • @facundoferrero1395
    @facundoferrero1395 Месяц назад +3

    postgres also has the ILIKE that doesnt require to lower the columns

  • @nove1398
    @nove1398 Месяц назад +1

    Finally, this is how it's done!

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +1

      Should I explore more heavy-duty options?

    • @nove1398
      @nove1398 Месяц назад

      @@MilanJovanovicTech this is fine for me. If others request alternatives then you can consider it.

  • @SachinBaral-wv9wf
    @SachinBaral-wv9wf Месяц назад +1

    Thank you so much Milan. This was very useful.

  • @caribouroadfarm
    @caribouroadfarm Месяц назад

    Thanks for the video; I learned a lot of things. The only thing I don't understand in your first example is why you would run a search on non-indexed columns to begin with.

  • @Mazzphysics
    @Mazzphysics Месяц назад

    Pretty cool, will most likely swap to postgres for my home project and try it out :D

  • @chanakachathuarngaathapath7282
    @chanakachathuarngaathapath7282 18 дней назад +1

    After adding a tsvector in Entity Framework, is there a way to automatically regenerate its values when updating an existing entity or creating a new one? Or do we need to manually implement a trigger for updating the tsvector? and also EF.Functions.PhraseToTsQuery does not work for partial word matching. Could you provide some guidance on this?

    • @MilanJovanovicTech
      @MilanJovanovicTech  17 дней назад +1

      A tsvector column is automatically updated when the row is modified

  • @youssefwael8
    @youssefwael8 14 дней назад

    Thanks, Milan, for the video. Amazing content as usual!!
    What if I want Language invariant FTS? The column could have multiple languages and I want it invariant, what will be the changes to this solution?

    • @MilanJovanovicTech
      @MilanJovanovicTech  13 дней назад +1

      Need to do some additional work in the database, let me see if I can find some resources

  • @vasiliylu8054
    @vasiliylu8054 Месяц назад +1

    Thanks, it's big nice work!

  • @charbelbeainy971
    @charbelbeainy971 29 дней назад

    Hello Milan,
    Awesome video. I wanted to ask if there's a way you can apply fuzziness to your search with the method you have used

    • @MilanJovanovicTech
      @MilanJovanovicTech  29 дней назад +1

      You'd probably have to implement custom support for this in SQL, maybe via a function that you can call as EF.Function

  • @haraheiquedossantos4283
    @haraheiquedossantos4283 Месяц назад

    Very good.
    What about if you want pagination. How do you deal with it using FTS in Postgres?

  • @antonmartyniuk
    @antonmartyniuk Месяц назад

    Awesome video, enjoyed it

  • @andrw8946
    @andrw8946 Месяц назад

    Hello.
    Any news for the Cursor AI technology? You said you gonna upload in depth video

  • @elaceDev
    @elaceDev 10 дней назад

    Hi, this video is a great help. How about for SQL Server database? ts vector is not supported in SQL Server. Thank you.

  • @gtavgameplaytv2200
    @gtavgameplaytv2200 23 дня назад

    Hello! Can you tell me which package needs to be installed for the studio to see the HasMethod() extension method? I still can't find it

  • @dcernach
    @dcernach Месяц назад

    That was a great video! I never heard abot lunr, I`m gonna check it! By the way, Milan. there is something like that using ef core with SQL Server. Full Text Search in SQL server is a pain!

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад

      Full writeup on Lunr here: www.milanjovanovic.tech/blog/how-i-implemented-full-text-search-on-my-website

  • @mohideenasraf7837
    @mohideenasraf7837 27 дней назад

    Can you please make a video of PostgreSQL partition with EF core?
    I tried, when I scaffolding using dotnet scaffold command it is retriving only the partitioned table, but it is supposed to be retrive partitioning table. I need your advice here.

  • @omerabay
    @omerabay Месяц назад

    Thanks for the informations Milan. It was really useful. How we can make a choose between Elasticsearch and PostgreSql for full-text search? Also Can we implement this feature using Marten?

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +1

      | How we can make a choose between Elasticsearch and PostgreSql for full-text search?
      You choose based on your requirements and if you can implement what you need to build.

    • @omerabay
      @omerabay Месяц назад

      @@MilanJovanovicTech Thanks Milan

  • @Mec2005
    @Mec2005 23 дня назад

    What would a multi language system look like? How should be a config value?

    • @MilanJovanovicTech
      @MilanJovanovicTech  22 дня назад +1

      It's a bit more complicated, need to do some additional setup in DB

  • @Дмитро-ы2л
    @Дмитро-ы2л Месяц назад

    Thx Milan!

  • @_NguyenHaoTien
    @_NguyenHaoTien 29 дней назад

    If you have two tables of users and posts with a relationship one to many
    How can you create the vector to use full text-search?

  • @atler9865
    @atler9865 Месяц назад

    Thanks for great content! Does anyone know, MS SQL Server have the same features? As I saw, for native Full Text Search you can only setup one field per table for Full Text Search feature, but it will also search slowly if you use Contains method to search from the middle of the some word for example. But in the same time it will search much faster if you search from the start of each word.

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад

      SQL Server supports full-text search. Not sure how you'd use it from EF Core, but there should be a function like EF.FreeText

  • @harshgaur4867
    @harshgaur4867 Месяц назад

    Waiting for your .Net Api course when you are launching it

  • @PedroFernandez-iv2uv
    @PedroFernandez-iv2uv 22 дня назад

    Milan, does this work with Microsoft SQL Server?

    • @MilanJovanovicTech
      @MilanJovanovicTech  21 день назад

      This code - not exactly. But SQL Server also has full-text search, you'd just need to adapt the implementation.

  • @sonpt
    @sonpt 10 дней назад

    Hi, thanks a lot, but how to do you search Vietnamese ?

  • @fabiooo
    @fabiooo Месяц назад

    What's the client that you use to trace your calls?

  • @saifumar3001
    @saifumar3001 Месяц назад

    @Milan Great videos Thanks for your work. Can you please also make a video or blog on AntiFrogeryTokken using Angular + .NET 8 Core to prevent CSRF attacks, use anti-forgery tokens

  • @simonsanden1639
    @simonsanden1639 Месяц назад

    Is your VS theme available somewhere?

  • @AhmedMohammed23
    @AhmedMohammed23 Месяц назад

    can i enter two languages in to_tsvector i have the same column that can have both english and arabic text what is the best way to deal with case like this?

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад

      With a bit of added configuration, yes

    • @AhmedMohammed23
      @AhmedMohammed23 29 дней назад

      @@MilanJovanovicTech my next question would be how? i didn't find any searching only any resources would be greatly appreciated, thanks.

  • @MilanDendis
    @MilanDendis Месяц назад

    very good video ;)

  • @renebu2204
    @renebu2204 26 дней назад

    Thank you awsome video.
    Does sombody here know is there also something similar for MS SQL Server?

    • @MilanJovanovicTech
      @MilanJovanovicTech  26 дней назад +1

      Of course: learn.microsoft.com/en-us/sql/relational-databases/search/full-text-search

    • @renebu2204
      @renebu2204 26 дней назад

      @@MilanJovanovicTech Thanks 👍

  • @PanSzelescik
    @PanSzelescik 14 дней назад

    Thanks, but pg_trgm wouldn't be better to search because can look for parts of the word? Could you delve more deeply into this topic?

  • @rafazieba9982
    @rafazieba9982 Месяц назад +3

    Then you have couple of people who use your system in france and everything falls apart. Not mentioning the Turkish "i" issue.

  • @Fikusiklol
    @Fikusiklol 19 дней назад

    Hello!
    Yet its good to know that Postgres has text index - its nowhere near compared to Elastic engine in terms of API and functionality.
    Also, if you're using normalized data - gl with sharding.
    All in all, using relational db for searches seems off and weird.
    if your requirements for search aint high and something basic - then just go for Mongo, at least you wont be having problems when sharding.

  • @sunzhang-d9v
    @sunzhang-d9v Месяц назад +1

    Can MSsql be used?

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +1

      Yes, SQL Server supports this feature. Not sure how you'd use it from EF Core, but there should be a function like EF.FreeText

    • @mtsmithtube
      @mtsmithtube Месяц назад +1

      Then he would have to change the title of the video

    • @sunzhang-d9v
      @sunzhang-d9v Месяц назад

      @@mtsmithtube 🤣

  • @canergurelsoy6875
    @canergurelsoy6875 Месяц назад

    Good one,
    in a world where data security is important this DOESN'T WORK on encrypted column.
    Thanks for sharing.

    • @MilanJovanovicTech
      @MilanJovanovicTech  Месяц назад +1

      Which DB/Service supports full-text search on encrypted columns?

  • @sunzhang-d9v
    @sunzhang-d9v Месяц назад +1

    First

  • @mesutdemirci7933
    @mesutdemirci7933 Месяц назад

    Thank you so much Milan. This was very useful.