The examples I've seen for sphinx search don't really use joins. If I had a schema like this (one book has multiple reviews),
create table book ( id int auto_increment, title varchar(200), summary longtext );
create table reviews ( id int auto_increment, book_id int, review longtext );
What sort of query should I give to sphinx so that I can search for the words in the review and it will return the corresponding book. If I use a regular inner join each review will be a single document and that doesn't correspond to what's visible on the site (single page contains book info and all reviews).
What do you suggest? Should I create a denormalized table for the search documents and use the rendered page as input e.g.:
create table sphinx_input (
id int, -- corresponds 1..1 to book.id
contents longtext -- everything on the page
);
and modify this for every change to books and reviews?