Exists query is quiet slower than terms query

document like

 {
"address": {
    "street": "ss",
    "city": "ffff",
    "country": "jjjj"
},
"links": [
    {
        "name": "Google",
        "url": "http://www.google.com"
    },
    {
        "name": "Baidu",
        "url": "http://www.baidu.com"
    },
    {
        "name": "SoSo",
        "url": "http://www.SoSo.com"
    }
]
}

I have almost 1 billiion docs use about 3T disk,druring 10 servers with 8 cores 32G memory, ssd
query like

{
"size": 10,
"query": {
    "bool": {
        "filter": [
            {
                "exists": {
                    "field": "address"
                }
            },
            {
                "exists": {
                    "field": "links"
                }
            }
        ]
    }
}
}

will take about 300 seconds but term query will return quickly , why this happen? is there any difference between term query and exists query ? How can I speed up exists query?

you can use the profile API to figure out which part of your search took so much time. Maybe share those results, and then we can go from there.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.