Use full text search in fields

Newbie here, is there a way I can fields defined as full text search fields?
10 Replies
aidalgol
aidalgol•3mo ago
What do you mean by "full text search fields"?
Abu kumathra
Abu kumathraOP•3mo ago
basically instead of using ilike to check if string is included in an amalgamation of columns, use tsvector
aidalgol
aidalgol•3mo ago
I might be more of a newbie than you, then, because this is the first time I've heard of tsvector. 😅
Abu kumathra
Abu kumathraOP•3mo ago
Now that I am thinking about this, I basically need to create a migration and create the FTS index, and then just use raw PGSql so thank you either way I thought like it can be defined like the vectorization stuff
Gonzalo Muñoz
Gonzalo Muñoz•3mo ago
AshAI might be useful here. It's built for this
Abu kumathra
Abu kumathraOP•3mo ago
I don't want to use embeddings, I need to do some benchmarking I have a lot of fields and some of them have on value I could concat everything but I need it for filtering
barnabasj
barnabasj•3mo ago
This is a bit more manual work, but I have also done it in the past using custom_statments for createing the indexes and fragment in calculations to make it searchable and surface things like ts_rank and ts_headline
Abu kumathra
Abu kumathraOP•3mo ago
do you have a snippet I can use as a reference? I am new to ash
barnabasj
barnabasj•3mo ago
it's a bit more involved in there because it's an extension that puts the search elements on the resource but I just looked at the functions and copied the sql into custom_statments and calculations using fragments

Did you find this page helpful?