如果我们在db中有一个字段,如“abc:bcd”,如果我们搜索它,elasticsearch就找不到它。我的问题是:索引时,elasticsearch如何取代冒号?
abc:bcd在索引中变成了什么?
我试图找到答案,但没有运气。我需要一些简单的答案,如: abc:bca => abc_bca
文档不包含获取索引值的简单方法,例如: curl -XGET'主持人:9200 / indices / detailed'...然后我会查看数据并通过abc查找:bcd并查看它变成了什么
请帮忙
答案 0 :(得分: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"}}]}}