How to use full-text search under mysql+mybatis
This article is about how to use full-text search under mysql+mybatis. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The first step is to click on the full-text search full text type index on your column that requires full-text search. Note that my example is that the column is of type longText.
The first step is to build the fulltext type index as follows
Select full text for index type
Step 2:
Verify whether full-text search sql works
Step 3:
I use the mybatis framework and change the automatically generated example condition settings and mapper.xml file contents
Page page = (Page) logMapper.selectByExample (tLogExample)
Finally, the sql statement generated by the mybatis framework basically uses the full-text search syntax.
Note that the premise of using the full-text search function in mysql is to establish a full text type index on the column to be searched.
Finally, the sql statement generated by the mybatis framework basically uses the full-text search syntax.
Select id, log_type, system_name, visit_time,message from t_log WHERE (MATCH (message) AGAINST ('* FA9X0D00000001*' IN BOOLEAN MODE))
Thank you for reading! This is the end of the article on "how to use full-text search under mysql+mybatis". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!