Configuring Sphinx for Search
Last updated May 14th, 2019 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$290 per month—let's make that $500!
Learn moreRequirements for Sphinx Search with Discuss¶
Discuss has only few requirements to work with Sphinx search:
- Sphinx 2.0 or newer installed on server (current Discuss version tested on 2.0.8)
- Configured sources and indexes for discuss post table (Configuration example below)
- Configured MODX system settings correctly
For more how to install Sphinx can be found from official Sphinx documentation
Example Configuration¶
Example configuration uses two indexes for Sphinx; the main index and delta index for faster and more frequent indexing. Using delta index is preferred when forum is active or there are considerable amount of posts which can cause indexer to take long re-indexing main index. Delta index can also keep search more up to date with results depending on indexing frequency.
Before running indexer with the configuration, create new table with next sql piece to your database which has discuss installed. You can rename the delta table to anything you want, as long it matches with the pre_query delta update and delta query table in the main index.
You can read more about delta index updates and merging to main index from official documentation for Delta Updates
Setting Sphinx to Discuss Settings¶
Go to System Settings and change the following settings:
- discuss.search_class -> Change to disSphinxSearch
- discuss.sphinx.host_name -> Set to hostname where Sphinx server is running
- discuss.sphinx.indexes -> List of indexes mentioned in the configuration file. The list can be separated with semicolon, comma or space
- discuss.sphinx.port -> Set port number that Sphinx is listening to
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$290 per month—let's make that $500!
Learn more