Elasticsearch匹配查询不起作用

时间:2017-10-29 08:13:06

标签: elasticsearch

我在elasticsearch中有4个文档。下面是它的样子

https://gist.github.com/adamwathan/3584d1904e4f4c36096f

我正在尝试仅在Python中提到单词title的位置查询文档。我正在使用head插件,下面是我传递的GET命令。

enter image description here

但是,我没有获得提及Python的文档,而是获取所有文档。

{
"took": 8,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 4,
"max_score": 1,
"hits": [
{
"_index": "library",
"_type": "book",
"_id": "2",
"_score": 1,
"_source": {
"title": "Building machine learning systems in JAVA",
"publish_date": "July 2014",
"price": 59.9
}
}
,
{
"_index": "library",
"_type": "book",
"_id": "4",
"_score": 1,
"_source": {
"title": "Building machine learning systems in C++",
"publish_date": "July 2016",
"price": 79.9
}
}
,
{
"_index": "library",
"_type": "book",
"_id": "1",
"_score": 1,
"_source": {
"title": "Building machine learning systems in Python",
"publish_date": "July 2013",
"price": 49.9
}
}
,
{
"_index": "library",
"_type": "book",
"_id": "3",
"_score": 1,
"_source": {
"title": "Building machine learning systems in SCALA",
"publish_date": "July 2015",
"price": 69.9
}
}
]
}
}

不确定我缺少什么

1 个答案:

答案 0 :(得分:1)

这可能是由您用来发送请求的工具引起的。 GET经常不支持身体POST。请改用input_file="day1.ale" input_data=$(cat $input_file | tr \\11 \\7) # replace tabs with alarm bell while IFS=$'\a' read Name Tracks Start End Take Tape UNC FPS Reel Scene do echo $FPS done <<< "$input_data"