例如,我有 3 个表:
documents (
id serial PRIMARY KEY,
title character varying(256),
content text,
created timestamp with time zone
);
tags (
id serial PRIMARY KEY,
tag_content character varying(128)
);
tag_assoc (
id serial PRIMARY KEY,
document_id integer,
tag_id integer
);
我希望能够搜索documents
、title
和content
for 标签。
我sql_query
到目前为止非常简单,例如:
sql_query SELECT id, title, content FROM documents
我将如何设置 Sphinx sql_query 以便将与每个文档关联的标签连接到它们?