As translated, Mroonga is a storage engine for MySQL. It provides fast full-text search functionality for all MySQL users.
Here's a direct demonstration of how to enable the Mroonga storage engine on MARIADB
1) Load Mroonga plugin
MariaDB [(None)]>INSTALL SONAME ' Ha_mroonga ';
MariaDB [(none)]> CREATE FUNCTION last_insert_grn_id RETURNS INTEGER SONAME ' ha_mroonga.so ';
2) Build a table and test it.
MariaDB [(none)]> CREATE database Jerry;
MariaDB [(none)]> Use Jerry
MariaDB [jerry]> CREATE TABLE t1 (ID int not null,name varchar (+) not null,notes Text,fulltext Index (notes)) engine =mroonga;
3) randomly inserting some data
MariaDB [jerry]> INSERT INTO T1 values (1, ' wipe ', ' I will not tell you ');
Query OK, 1 row Affected (0.00 sec)
MariaDB [jerry]> INSERT INTO T1 values (2, ' cheer ', ' I won't tell you ');
Query OK, 1 row affected (0.01 sec)
MariaDB [jerry]> INSERT INTO T1 values (3, ' Dashaba ', ' Mori horse costume ');
Query OK, 1 row Affected (0.00 sec)
MariaDB [jerry]> INSERT INTO T1 values (4, ' Victor ', ' Omori ma Investment Limited ');
Query OK, 1 row Affected (0.00 sec)
MariaDB [jerry]> INSERT INTO T1 values (5, ' Kukumimilulu ', ' Sen Ma cross-border e-commerce Co., Ltd. ');
Query OK, 1 row Affected (0.00 sec)
MariaDB [jerry]> INSERT INTO T1 values (6, ' constructed ', ' father Wang United Malaysia cross-border e-commerce Co., Ltd. ');
Query OK, 1 row Affected (0.00 sec)
4) query with the following command
MariaDB [jerry]> SELECT * from T1 where match (notes) against (' Omori horse ' in BOOLEAN MODE);
+----+-----------+--------------------------------------------------+
| ID | name | Notes |
+----+-----------+--------------------------------------------------+
| 4 | Victor | Omori Horse Investment Co., Ltd. |
| 6 | Constructed | Father Wang United Malaysia cross-border e-commerce Co., Ltd. |
+----+-----------+--------------------------------------------------+
2 rows in Set (0.00 sec)
5) Through the execution plan we can see that the full-text index of notes has been used, and only one line is scanned
MariaDB [jerry]> Explain select * from T1 where match (notes) against (' Omori horse ' in BOOLEAN MODE);
+------+-------------+-------+----------+---------------+-------+---------+------+------+---------------------- -------------+
| ID | Select_type | Table | Type | Possible_keys | Key | Key_len | Ref | Rows | Extra |
+------+-------------+-------+----------+---------------+-------+---------+------+------+---------------------- -------------+
| 1 | Simple | T1 | Fulltext | Notes | Notes | 0 | | 1 | Using where with pushed condition |
+------+-------------+-------+----------+---------------+-------+---------+------+------+---------------------- -------------+
1 row in Set (0.00 sec)
This article is from the "operation and maintenance of life" blog, please make sure to keep this source http://jinyan2049.blog.51cto.com/881440/1942333
MariaDB10.2.6 enabling the Mroonga storage engine for full-text indexing