Full Text Search in .NET With PostgreSQL and EF Core

preview_player
Показать описание

Learn how to implement powerful full-text search capabilities in your .NET applications using PostgreSQL and Entity Framework Core. This tutorial will guide you through setting up full-text search indexes, writing efficient search queries, and integrating them seamlessly with EF Core. Discover how to leverage PostgreSQL's advanced text search features to enhance your application's search functionality.

How I Implemented Full-Text Search On My Website

GiST and GIN Index Types (PostgreSQL)

Check out my courses:

Read my Blog here:

Join my weekly .NET newsletter:

Chapters
0:00 Simple EF Core search
3:54 Normalizing search terms
7:10 Postgres full-text search (GIN index)
12:33 Ranking search results by relevance
16:01 EF Core + Npgsql alternative
20:45 Boosting search terms (weighted search)
Рекомендации по теме
Комментарии
Автор

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.

markovuckovic
Автор

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

nikolaluburic
Автор

Thanks for the video it really helped me speed up some searches by removing a ton of manual code I had for normalizing and sorting etc!!! Easy video to follow along with as well.

joshuadawson
Автор

Thank you so much Milan. This was very useful.

SachinBaral-wvwf
Автор

use this pair with an ollama-HuggingFace local LLM model, and you will get a RAG/LLM (I am implementing it right now with aspire, it would be awesome to see your implementation if you do it).
If postgres vector generation is not good enought (I doubt it), then I will still use it as a vector database and will use another embedding model generator (BI-Encoder).
I started doing videos just to showcase my habilities (for job matters), and you Milan were a part that motivated me to do it.

Midicifu
Автор

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

Mazzphysics
Автор

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.

caribouroadfarm
Автор

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

facundoferrero
Автор

I believe the bottom line of this video is that devs should know that when performing text search, using LINQ, if we enforce the string casing with ToUpper or ToLower there is a chance we break the index of the char/ varchar column if there is collation mismatch.
So, just avoid using ToUpper or ToLower.

andrw
Автор

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!

dcernach
Автор

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

harshgaur
Автор

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

charbelbeainy
Автор

Awesome video Milan. But in 4:57 how can you have the queries like that .I am using dotnet 9 and i don't know how to configure like that

quangphata
Автор

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?

omerabay
Автор

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

haraheiquedossantos
Автор

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?

youssefwael
Автор

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

andrw
Автор

nice, I like. what will happen when the user is not searching for exact terms but just parts of them. for example: mono instead of monolith?

cuserroro
Автор

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

Mec
Автор

@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

saifumar
visit shbcf.ru