is this a good way to implement search functionality
i feel they will be a better way....what i am trying to do is to display a normal query then when input is provided it uses it to for the search
24 Replies
Postgres and mySQL support full text search - better use that for the sql query instead of”contains”
must i use fulltext search?
its not a social media stuff its for admin panel
No
But it is faster and better for general text search purposes
includes is fine, but performance its weird
For a single feature like this your approach works fine too
Just keep the full text option in mind when developing such features, makes life easier for a great ux
if i do full text wont that be slower because it will go wild meanwhile i already know where what i am looking for is located
The database guys behind features like full text search did incredible optimizations, which actually makes it faster
word search in database with %% is very hard in performance terms
avoid if you can
Also provides tolerance for spelling errors etc
Stack Overflow
Postgres full text search and spelling mistakes (aka fuzzy full tex...
I have a scenario, where I have data for informal communications that I need to be able to search. Therefore I want full text search, but I also to make sense of spelling mistakes. Question is how ...
But please dont burden yourself with over engineering. For most projects your implementation works fine enough
what of
okay
%% means match if the word includes
thats raw sql quires right?
yep
if you can, just use full text search
ok thanks
but will this also be good in a situation where i want to search by createdAt(DateTime)
you can probably use the OR [], just like here
ok thanks
this is the type of search i am trying to implement
i don't think full text search will work for this
sorry the search is kinda out of context
can filter and sorting handle such?
Full text search works for columns, combine them to implement a search for additional meta data (name, category, manufacturer, …)
so are
you saying it will work?
that is full text search]
Absolutely, add fuzzy search im top of it for an optimal UX☝🏼