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