mongodb中文或者日文索引

237 阅读1分钟

#直接创建

db.slope_2022_market.createIndex( { searchTerm: "text", description: "text" } );
db.slope_2022_market.getIndexes();

image.png

image.png 匹配的效果并不好

#删除创建的索引-找到对应的索引名称 > db.slope_2022_market.dropIndex('searchTerm_text_description_text' ); image.png

重新创建

`db.slope_2022_market.createIndex( { searchTerm : "text" }

);`

image.png

image.png image.png

并没有匹配到想要的结果

设置使用汉语的模式均失败

image.png

image.png