【发布时间】:2018-04-10 10:06:50
【问题描述】:
我在 elasticsearch 中有 4 个文档。下面是它的样子
我正在尝试仅在 title 中提到单词 Python 的地方查询文档。我正在使用head 插件,下面是我传递的 GET 命令。
但是,我没有获取提到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
}
}
]
}
}
不知道我错过了什么
【问题讨论】:
-
这个答案可能会有所帮助:stackoverflow.com/questions/34795053/…
标签: elasticsearch