POST:{{HOST}} / _ search 当尝试使用以下查询查找条目时,ElasticSearch返回“没有为[parental_rating]注册的查询”错误。 我使用的是5.5.1 ES版本
{
"query": {
"bool": {
"filter" : {
"parental_rating" : {
"lte": 6
}
}
}
}
}
以下是它如何查看数据的示例:下面是示例数据的示例:
{
"took": 14,
"timed_out": false,
"_shards": {
"total": 128,
"successful": 128,
"failed": 0
},
"hits": {
"total": 182310,
"max_score": 1,
"hits": [
{
"_index": "gracenote_1528767603035",
"_type": "program",
"_id": "3a0cf999-bfd0-4195-a8e4-ccaaf1b5d4d3",
"_score": 1,
"_source": {
"imported_at": "Tue Jun 12 2018 00:21:09 GMT+0000 (UTC)",
"type": "program",
"title": "Rusty rockt!; Die Luftrettung",
"description": "Ruby nimmt an einemsen Rustyommen.",
"summary": "Ruby nimmt an einem TalRusty und den Bits.",
"short_summary": null,
"season_no": 1,
"episode_no": 8,
"season_id": "13005345",
"id": "91984",
"series_id": "13000950",
"people": [
{
"name": "Kyle Breitkopf",
"character": "Rusty",
"role": "Voice",
"id": "682794"
}
],
"genres": [
"78",
"11",
"2",
"99",
"44"
],
"parental_rating": 12,
答案 0 :(得分:0)
您可能在这里错过了range
个问题。正确的查询应如下所示:
{
"query": {
"bool": {
"filter" : {
"range": {
"parental_rating" : {
"lte": 6
}
}
}
}
}
}