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
Neto
Neto2y ago
Leonidas
Leonidas2y ago
Postgres and mySQL support full text search - better use that for the sql query instead of”contains”
Lopen
Lopen2y ago
must i use fulltext search? its not a social media stuff its for admin panel
Leonidas
Leonidas2y ago
No But it is faster and better for general text search purposes
Neto
Neto2y ago
includes is fine, but performance its weird
Leonidas
Leonidas2y ago
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
Lopen
Lopen2y ago
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
Leonidas
Leonidas2y ago
The database guys behind features like full text search did incredible optimizations, which actually makes it faster
Neto
Neto2y ago
word search in database with %% is very hard in performance terms avoid if you can
Leonidas
Leonidas2y ago
Also provides tolerance for spelling errors etc
Leonidas
Leonidas2y ago
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 ...
Leonidas
Leonidas2y ago
But please dont burden yourself with over engineering. For most projects your implementation works fine enough
Lopen
Lopen2y ago
what of
||
||
okay
Neto
Neto2y ago
%% means match if the word includes
Lopen
Lopen2y ago
thats raw sql quires right?
Neto
Neto2y ago
yep if you can, just use full text search
Lopen
Lopen2y ago
ok thanks but will this also be good in a situation where i want to search by createdAt(DateTime)
Neto
Neto2y ago
you can probably use the OR [], just like here
Lopen
Lopen2y ago
ok thanks
Lopen
Lopen2y ago
this is the type of search i am trying to implement
Lopen
Lopen2y ago
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?
Leonidas
Leonidas2y ago
Full text search works for columns, combine them to implement a search for additional meta data (name, category, manufacturer, …)
Lopen
Lopen2y ago
so are you saying it will work? that is full text search]
Leonidas
Leonidas2y ago
Absolutely, add fuzzy search im top of it for an optimal UX☝🏼
Want results from more Discord servers?
Add your server