首页 文章

弹性搜索在索引时映射冒号是什么?

提问于
浏览
0

如果我们在db中有一个字段,如“abc:bcd”,如果我们搜索它,elasticsearch就找不到它 . 我的问题是:索引时,elasticsearch如何取代冒号?

abc:bcd在索引中变成了什么?

我试图找到答案,但没有运气 . 我需要一些简单的答案,例如:abc:bca => abc_bca

文档不包含获取索引值的简单方法,例如:curl -XGET'host:9200 / indexes / detailed'...然后我将查看数据并通过abc:bcd查找并查看它是什么成为

请帮忙

1 回答

  • 0

    显示你的映射;默认情况下,它应该是可访问的 .

    $ curl -XDELETE "http://localhost:9200/test/"
    #{"acknowledged":true}
    
    $ curl -XPOST "http://localhost:9200/test/docs/" -d '{a: "abc:def"}'
    {"_index":"test","_type":"docs","_id":"NjWf3CNlQCuQiA8dGp8aVw","_version":1,"created":true}
    
    $ curl -XPOST "http://localhost:9200/test/_search" -d '{query: {term: {a: "abc:def"}}}'
    {"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.30685282,"hits":[{"_index":"test","_type":"docs","_id":"NjWf3CNlQCuQiA8dGp8aVw","_score":0.30685282,"_source":{a: "abc:def"}}]}}
    

相关问题