Slide 33
Slide 33 text
SELECT "products"."title",
"categories"."name" AS category_name,
"groups"."name" AS group_name
FROM "products"
INNER JOIN "categories"
ON "products"."category_id" = "categories"."id"
INNER JOIN "groups"
ON "products"."group_id" = "groups"."id"
WHERE (
to_tsvector('english', "products"."title") ||
to_tsvector('english', "categories"."name") ||
to_tsvector('english', "groups"."name")
) @@ (
to_tsquery('english', 'batman') &&
to_tsquery('english', 'action')
)
You might not need ElasticSearch - @tegonl