Use the MongoDB Search string type to index string fields. Use the MongoDB Search phrase, querystring, span, text, wildcard, regex, and moreLikeThis operators to query fields indexed as the string type.
string 类型注意事项
string 类型不支持字符串字段的所有MongoDB搜索功能。将字符串字段作为词元进行索引:
对字符串字段运行分面查询。
按字符串字段对MongoDB搜索结果进行排序。
MongoDB Search 动态映射 使用默认typeSet 仅将字符串字段索引为 string 类型。指定自定义 typeSet 以将字符串动态索引为 token 或 autocomplete 以使用其支持的功能。
重要
MongoDB Search 不会对分析器词元大小超过 32766 字节的字符串字段索引。 如果使用关键字分析器,则不会对超过 32766 字节的字符串字段编制索引。