ES基础(二十) 单字符串多字段查询:Dis Max Query

ES基础(二十) 单字符串多字段查询:Dis Max Query

 

 

 ES基础(二十) 单字符串多字段查询:Dis Max Query

 

 

 ES基础(二十) 单字符串多字段查询:Dis Max Query

 

 

 ES基础(二十) 单字符串多字段查询:Dis Max Query

ES基础(二十) 单字符串多字段查询:Dis Max Query

ES基础(二十) 单字符串多字段查询:Dis Max Query

 

 ES基础(二十) 单字符串多字段查询:Dis Max Query

 

 ES基础(二十) 单字符串多字段查询:Dis Max Query

 

 ES基础(二十) 单字符串多字段查询:Dis Max Query

 

PUT /blogs/_doc/1
{
    "title": "Quick brown rabbits",
    "body":  "Brown rabbits are commonly seen."
}

PUT /blogs/_doc/2
{
    "title": "Keeping pets healthy",
    "body":  "My quick brown fox eats rabbits on a regular basis."
}

POST /blogs/_search
{
    "query": {
        "bool": {
            "should": [
                { "match": { "title": "Brown fox" }},
                { "match": { "body":  "Brown fox" }}
            ]
        }
    }
}

POST blogs/_search
{
    "query": {
        "dis_max": {
            "queries": [
                { "match": { "title": "Quick pets" }},
                { "match": { "body":  "Quick pets" }}
            ]
        }
    }
}


POST blogs/_search
{
    "query": {
        "dis_max": {
            "queries": [
                { "match": { "title": "Quick pets" }},
                { "match": { "body":  "Quick pets" }}
            ],
            "tie_breaker": 0.2
        }
    }
}

 

上一篇:快速排序


下一篇:并查集