Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
SphinxSE uses SPH_MATCH_ALL by default, which is deprecated (http://sphinxsearch.com/docs/current.html#matching-modes). To use a different matching mode, it is necessary to specify a different mode in the query string (https://mariadb.com/kb/en/about-sphinxse/), like this:
SELECT * FROM t1 WHERE query='test it;mode=extended';
|
It would be nicer if there were a way to configure the matching mode so that it was not necessary to specify it for each query. There are a variety of options for this, including a global variable, session variable, and per-table options.
The easiest and most consistent option (from a support/troubleshooting perspective, at least) is probably a per-table option. When creating the SphinxSE table, a matching mode could be specified, and that mode would be used for all queries against the table unless an explicit matching mode were given for a query against the table. For example:
CREATE TABLE t1
|
(
|
id INTEGER UNSIGNED NOT NULL,
|
weight INTEGER NOT NULL,
|
query VARCHAR(3072) NOT NULL,
|
group_id INTEGER,
|
INDEX(query)
|
) ENGINE=SPHINX CONNECTION="sphinx://localhost:9312/test" MODE="extended";
|
Friendly names ("phrase"/"boolean"/"ext") as well as API mode names ("SPH_MATCH_PHRASE"/"SPH_MATCH_BOOLEAN"/"SPH_MATCH_EXTENDED") should be accepted.
The default mode for tables where no mode is specified should continue to be SPH_MATCH_ALL for legacy reasons.
An explicit matching mode in the query would override the default matching mode for the table.