elasticsearch - 创建后elasticsearch映射为空
问题描述
我正在尝试使用 search_as_you_type 数据类型为我的弹性搜索创建一个自动完成索引。我运行的第一个命令是
curl --request PUT 'https://elasticsearch.company.me/autocomplete' \
'{
"mappings": {
"properties": {
"company_name": {
"type": "search_as_you_type"
},
"serviceTitle": {
"type": "search_as_you_type"
}
}
}
}'
返回
{"acknowledged":true,"shards_acknowledged":true,"index":"autocomplete"}curl: (3) nested brace in URL position 18:
{
"mappings": {
"properties": etc.the rest of the json object I created}}
然后我重新索引使用
curl --silent --request POST 'http://elasticsearch.company.me/_reindex?pretty' --data-raw '{
"source": {
"index": "existing_index"
},
"dest": {
"index": "autocomplete"
}
}' | grep "total\|created\|failures"
我希望看到一些"total":1000,"created":5
等,但从终端得到某种响应,但我什么也没得到。此外,当我检查我的自动完成索引的映射时,通过运行curl -u thething 'https://elasticsearch.company.me/autocomplete/_mappings?pretty'
,我得到一个空的映射结果:
{
"autocomplete" : {
"mappings" : { }
}
}
我在创建索引或重新索引时出错了吗?我期待自动完成映射显示我正在搜索的两个字段,即:“company_name”和“serviceTitle”。任何想法如何解决?
解决方案
推荐阅读
- python - 如何在虚拟环境中使用 Python nftables 库?
- python - Python - 使用今天的日期复制文件夹中的最新文件并执行在文件中找到的宏
- amazon-web-services - Amazon Connect ChatJS 属性“getMediaController”不存在
- php - 如何允许每个客户有多个购物车?
- django - 'Meal' 对象不是可迭代的 django rest 框架
- mongodb - MongoDB:按数组大小和总计过滤
- rest - 根据用户访问级别隐藏 REST API 响应中的一些属性
- python - df 删除高度相关列的更快方法,用于 ML 中的预处理,具有多处理池
- redmine - 如何在 Redmine 中删除相关任务?
- c - 从c中的链表中删除名称时出错