簡體   English   中英

沒有為[query]錯誤的[query]注冊[int] elasticsearch的int ltr插件

[英]no [query] registered for [query] error int ltr plugin of elasticsearch

我正在為彈性搜索使用ltr插件,並且正在按照文檔中的說明進行操作。 這是我的功能集:

{
   "validation": {
     "params": {
         "keywords": "rambo"
     },
     "index": "movies"
    },
    "featureset": {
        "name": "movie_features",
        "features": [
            {
                "name": "title_query",
                "params": [
                    "keywords"
                ],
                "template_language": "mustache",
                "template": {
                    "query": {
                        "match": {
                            "title": "{{keywords}}"
                        }
                    }
                }
            }
        ]
    }
}

提交此請求時,出現以下錯誤:

 { "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "Cannot store element, validation failed." } ], "type": "illegal_argument_exception", "reason": "Cannot store element, validation failed.", "caused_by": { "type": "search_phase_execution_exception", "reason": "all shards failed", "phase": "query", "grouped": true, "failed_shards": [ { "shard": 0, "index": "movies", "node": "OixZfLQjRzmcY8yDxTCt9w", "reason": { "type": "query_shard_exception", "reason": "Cannot create query while parsing feature [title_query]", "index_uuid": "9TSirwWkQNOuMAkHFMpGvw", "index": "movies", "caused_by": { "type": "parsing_exception", "reason": "no [query] registered for [query]", "line": 1, "col": 10 } } } ] } }, "status": 400 } 

那怎么了 似乎elasticsearch無法構建查詢,但是我不知道我應該在查詢中更改什么。

我找到了答案。 您應該在模板中刪除查詢關鍵字:

"template": {
    "match": {
        "title": "{{keywords}}"
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM