gpt4 book ai didi

mysql - 仅全文搜索列值的前 100 个字符

转载 作者:行者123 更新时间:2023-11-29 14:01:04 27 4
gpt4 key购买 nike

如何在 MySQL 中执行全文搜索,仅搜索列中值的前 100 个字符?

最佳答案

创建全文索引时可以指定前缀长度

ALTER TABLE  table_name ADD FULLTEXT (
column (100)
);

http://dev.mysql.com/doc/refman/5.0/en/create-index.html

Prefix lengths are given in characters for nonbinary string types and in bytes for binary string types. That is, index entries consist of the first length characters of each column value for CHAR, VARCHAR, and TEXT columns, and the first length bytes of each column value for BINARY, VARBINARY, and BLOB columns.

关于mysql - 仅全文搜索列值的前 100 个字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15048576/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com