调整了索引类型,对文章全文进行检索

This commit is contained in:
pqcqaq 2024-10-17 23:38:41 +08:00
parent 77883fae1f
commit f9aa721ddd
1 changed files with 16 additions and 2 deletions

View File

@ -91,13 +91,27 @@ export const entityDesc: EntityDesc<
attributes: [
{
name: 'title',
size: 32,
},
],
config: {
unique: true,
// 索引类型,方便根据标题查找文章
type: 'fulltext',
// 标题使用btree索引进行前缀搜索
type: 'btree',
},
},
// 根据文章内容搜索的全文检索索引
{
name: 'content_fulltext',
attributes: [
{
name: 'content',
},
],
config: {
type: 'fulltext',
parser: 'ngram',
},
}
],
};