Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6133

SphinxSE should support configurable matching mode

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: None
    • 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.

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                Unassigned
                Reporter:
                kolbe Kolbe Kegel
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: