Sphinx 3

Update: Though sphinx search is still supported I strongly recommend using manticore search for new deployments.

Piler supports both sphinx version 2.2.x and 3.x. Sphinx 3 uses a slightly different configuration. In order to support both version 2 and 3, sphinx.conf should be executable. (Yes, sphinx can execute the config file, and read its output).

Note: sphinx version 2 data format is not compatible with version 3 format. If you have an existing sphinx index you have to reindex your emails if you want to switch to sphinx version 3.

Get sphinx 3.3.1 either from the piler download site (it contains only the binaries) https://download.mailpiler.com/generic-local/sphinx-3.3.1-bin.tar.gz or the https://sphinxsearch.com/downloads/current/. Make sure the binaries are in /usr/bin directory.

In sphinx.conf set SPHINX_VERSION to 331:

define('SPHINX_VERSION', 331);

Sphinx 3.3.1 issues with fulltext column names

Sphinx introduces an extra sql query check and it fails to execute the sql query if it thinks it’s incorrect, even though the underlying MySQL library says it’s fine.

There piler has introduced a new variable called SPHINX_STRICT_SCHEMA, and it’s by default on from piler 1.3.9 both in config.php and sphinx.conf.

If you have a sphinx version up to 3.2.x and you want to upgrade sphinx to 3.3.1, then you must drop your sphinx index data, make sure you enable SPHINX_STRICT_SCHEMA in piler, and you must reindex everything. Sphinx limitation on email address length

Due to some UTF-8 encoding limitations sphinx cannot perform the sphinxql query if it contains a token or email address exceeding 41 characters even though the query itself is syntactically correct. Unfortunately piler can’t do much other than cutting 42+ character long email addresses out of the assigned email addresses of the given user.

See https://bitbucket.org/jsuto/piler/issues/1082/no-sphinx-results-with-long-email for more.