为什么我的查询没有返回任何结果?

时间:2015-11-04 05:13:59

标签: elasticsearch

我是弹性搜索的新手,并且一直没能按照我的预期工作。我知道这个记录存在的事实,如果我使用"query": "kill"它将显示为"Kill Bill, Vol. 1"

但是,按照下面的方式编写,它会返回0次点击。
任何人都可以向我解释为什么这不符合我的预期吗?

{
    "from": 0,
    "size": 5,
    "_source": ["_id", "title"],
    "query": {
        "filtered": {
            "query": {
                "multi_match": {
                    "query": "kill bill",
                    "type": "best_fields",
                    "fields": [
                        "title^1",
                        "director",
                        "description"
                    ]
                }
            },
            "filter": {
                "term": {
                    "user_id": "1"
                }
            }
        }
    }
}

以下是映射:

{
    "items": {
        "mappings": {
            "external": {
                "properties": {
                    "director": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "user_id": {
                        "type": "long"
                    }
                }
            }
        }
    }
}

以下是存储的项目:

{
    "_index": "items",
    "_type": "external",
    "_id": "23",
    "_version": 136,
    "found": true,
    "_source": {
        "user_id": 1,
        "description": "A former assassin, known simply as The Bride (Uma Thurman), wakes from a coma four years after her jealous ex-lover Bill (David Carradine) attempts to murder her on her wedding day. Fueled by an insatiable desire for revenge, she vows to get even with every person who contributed to the loss of her unborn child, her entire wedding party, and four years of her life. After devising a hit list, The Bride sets off on her quest, enduring unspeakable injury and unscrupulous enemies.",
        "title": "Kill Bill, Vol.1",
        "director": "Quentin Tarantino"
    }
}

0 个答案:

没有答案