2

I recieved this error when performing a search with 746 words (it wasn't intentional someone pasted text into the wrong box).

HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE: Too many words in a FTS phrase or proximity search

The server is using MariaDB 10.2.14, what is the maximum limit? I couldn't find it in the MariaDB or MySQL docs.

2

It's 128.

I don't know yet if it's documented anywhere, but this from the source:

/* Maximum number of words supported in a phrase or proximity search. */
#define MAX_PROXIMITY_ITEM  128
...
    if (num_token > MAX_PROXIMITY_ITEM) {
            query->error = DB_FTS_TOO_MANY_WORDS_IN_PHRASE;
            goto func_exit;
    }

A practical experiment supports that:

MariaDB [foo]> select match(name) against(concat('"', repeat('foo ', 128), '" @8')) from test;
...
6 rows in set (0.01 sec)
MariaDB [foo]> select match(name) against(concat('"', repeat('foo ', 129), '" @8')) from test;
ERROR 191 (HY000): Too many words in a FTS phrase or proximity search

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.