栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

通过mongodb river在Elasticsearch中创建索引中的映射未生效

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

通过mongodb river在Elasticsearch中创建索引中的映射未生效

您必须首先使用索引设置(分析器)创建索引:

"analysis" : { "analyzer" : {      "str_search_analyzer" : {"tokenizer" : "keyword","filter" : ["lowercase"]       },       "str_index_analyzer" : {          "tokenizer" : "keyword",          "filter" : ["lowercase", "ngram"]     } }, "filter" : {     "ngram" : {         "type" : "ngram",         "min_gram" : 2,         "max_gram" : 20     } }        }

然后,您可以为您的类型定义一个映射:

"autocomplete_questions": {   "_boost" : {        "name" : "po",         "null_value" : 1.0   },   "properties": { "po": {     "type": "double" }, "text": {     "type": "string",     "boost": 3.0,     "search_analyzer" : "str_search_analyzer",     "index_analyzer" : "str_index_analyzer" }   }}

只有这样,您才能创建河流:

curl -XPUT "localhost:9200/_river/autocompleteindex/_meta" -d '{"type": "mongodb","mongodb": {    "host": "rahulg-dc",    "port": "27017",    "db": "qna",    "collection": "autocomplete_questions"},"index": {    "name": "autocompleteindex",    "type": "autocomplete_questions"} }

有帮助吗?



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/383379.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号