我将索引title_o作为非索引字段。查询以获得精确搜索不返回结果。当title_o匹配时,我需要查找文档是test1。请帮忙。弹性搜索中的完全匹配搜索不起作用
Indexed following documents:
curl -XPUT 'http://localhost:9200/test/test10/1' -d '
{
"doi":"1234",
"title":"this is test1",
"title_o":"this is test1"
}'
curl -XPUT 'http://localhost:9200/test/test10/3' -d '
{
"doi":"1234",
"title":"this is test3",
"title_o":"this is test3"
}'
Search:
curl -XGET 'http://localhost:9200/test/test10/_search?pretty=true' -d '
{
"query" : {
"filtered" : {
"filter" : {
"term" : {
"title_o" : "this is test1"
}
}
}
}
}'
你可以发布映射吗? – Tom 2015-04-02 23:51:12