The amount of data is one million, not too big. There is a field with a value length > 100, which is very long, including Chinese, English, and almost all characters. Full-text indexing is used, but it is not ideal:
1, the search is extremely slow, even using the index.
db.tests.find({'$text':{'$search':'test'}})
2, when searching for '', although it will be converted to '\', there will be no reflection, as if it is not running at all. Repeatedly exit, reopen (referring to the customer's mongo), and query again. It will fill up the memory (12G, except the system can use 11G) and freeze directly. Hard reboot.
db.tests.find({'$text':{'$search':'test.06'}}) #想要的。
但是通过web输入会变成
db.tests.find({'$text':{'$search':'test\1.06'}})
I don’t know if this kind of requirement is suitable for building an index?
Thanks
高洛峰2017-05-31 10:37:52
It is currently recommended to use a specialized search engine for full-text indexing. Although MongoDB supports full-text indexing, its functions are not very rich, the usage scenarios are limited, and there are problems in many cases, so it is not recommended.