[MDEV-6133] SphinxSE should support configurable matching mode Created: 2014-04-17  Updated: 2014-04-17

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Kolbe Kegel (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: 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.


Generated at Thu Feb 08 07:09:36 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.