5.5.2. mroonga_escape()

バージョン 3.08 で追加.

5.5.2.1. 概要

mroonga_escape UDF は与えられた文字列をエスケープする機能を提供します。そしてまたエスケープすべき文字を引数として受け取ります。

5.5.2.2. 構文

mroonga_escape() には必須引数と省略可能引数とがあります。:

mroonga_escape(string)
mroonga_escape(string, special_characters)

5.5.2.3. 使いかた

Here is the example query which use special characters to be escaped:

SELECT * FROM `symbols` WHERE MATCH(`content`) AGAINST(mroonga_escape("+hello_world()", "()") IN BOOLEAN MODE);

Here is the example about special characters which is escaped:

SELECT mroonga_escape("+-<>~*()\"\\\:");
-- \+\-\<\>\~\*\(\)\"\\\:

5.5.2.4. 引数

5.5.2.4.1. 必須引数

必須引数は string です。

5.5.2.4.1.1. string

エスケープしたいテキストを指定します。

5.5.2.4.2. 省略可能引数

special_characters は省略可能な引数です。

5.5.2.4.2.1. special_characters

エスケープする文字を指定します。

デフォルト値は +-<>~*()"\\: です。

5.5.2.5. 返り値

エスケープされた文字列を返します。