滿天的星座2017-05-02 09:23:58
Add some necessary knowledge:
mongo does not have a fixed field called name
的字段,看样子是你自己的表中有一个叫name
.
For general fields, the fields used as index keys do have some restrictions, please refer to the documentation. That is, less than 1024 bytes. Indexing will not be possible if this limit is exceeded. The full-text index does not exist to solve this problem. It mainly matches meaningful words, ignoring case, singular and plural, and tense. There is also documentation about full-text indexing. Please read it carefully. It is a completely different index form from ordinary indexing.
In addition, although a table can only have one full-text index, it can set different weights for different fields, and finally calculate a matching score.
天蓬老师2017-05-02 09:23:58
No matter how long a field like a name is, it basically does not require full-text indexing. An ordinary index will suffice, and it will be matched through prefix.
You can only use one full-text index for each collection. Good steel should be used on the edge, such as fields such as article content