我正在尝试使用search as you type数据类型为我的elasticsearch创建一个自动完成索引。我的第一个命令是
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
但终端机有React,但我什么也没得到。另外,当我检查自动完成索引的Map时,通过运行 curl -u thething 'https://elasticsearch.company.me/autocomplete/_mappings?pretty'
,我得到一个空Map结果:
{
"autocomplete" : {
"mappings" : { }
}
}
是在创建索引时出错还是在重新索引时出错?我希望autocompleteMap显示我正在搜索的两个字段,即:“company\u name”和“servicettitle”。有什么好办法吗?
暂无答案!
目前还没有任何答案,快来回答吧!