0
每次我使用相同的查詢,如以下代碼:ElasticSearch支持是否定義了固定的排名策略?
{
"bool": {
"should": [
{
"multi_match" : {
"query": "Will Smith",
"type": "cross_fields",
"fields": [ "first", "last" ],
"minimum_should_match": "50%"
}
},
{
"multi_match" : {
"query": "Will Smith",
"type": "cross_fields",
"fields": [ "*.edge" ]
}
}
]
}}
每次我使用不同的查詢字,但是PARAMS是相同的。
elasticsearch是否支持我們可以定義的這種策略,比如排名策略?每次我只需要輸入查詢。
這是從這個有點不同:http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-template-query.html#_stored_templates。我試過官方的例子,但無法得到我的查詢結果。你對如何使用url:/ _search而不是/ _search/template有任何想法嗎? – navins
如果您打算使用_search端點,您需要將模板查詢更改爲以下內容https://gist.github.com/keety/610613edbbbd8dce8e6b – keety
謝謝,它正在工作。 – navins