收录日期:2020/11/30 16:29:03 时间:2011-06-09 03:18:45 标签:php,search-engine,sphinx

We have a modular site and would like to setup searching by module.

For example, we have modules: news, customers, inventory

So if the user is on the news module and they do a search, the results should only be from the news table.

I've been reading Sphinx documentation but haven't seen if this is possible or not.

We are using PHP and from the Sphinx PHP API, there does not seem to be a method to set the source.

Can this be done? What would an example conf file look like?

If you want to have three sources, assuming you have three tables, right? Then you will have 3 indexes created, you can select which index to use when executing the query method

$sphinx->query ($query, $index);