Open
Description
I am trying to implement full text search to one of my apis, here's an example postgres sql query:
SELECT *
FROM recipes
WHERE to_tsvector('english', description || ' ' || name @@ to_tsquery('english', 'uni:*');
I've attempted to try and do the below within the code but noticed the where clause is only Critera.CriteriaStep type and needs to be chained with some operator to make it a Criteria:
Criteria criteria = Criteria.where("to_tsvector('english', " + VECTOR_FUNC + "@@ to_tsquery('english', 'sec:*');");
this.template
.select(RecipeEntity.class)
.matching(Query.query(criteria)).all();
Or would I have to do something like below? I am relatively new to using this framework and apologies if this has already gone answered.
databaseClient
.sql("SELECT id, type FROM recipes WHERE to_tsvector('english', description || ' ' || name @@ to_tsquery('english', :searchText")
.bind("searchText", searchText)