I've come up with something that will allow me to get the minimun level... 
Now, do I need to do this at the client level to get the 'max' number... 
say I want a range between 5 and 10... how do I limit the results to n 
number of children? 

{
    "min_score": 5,
    "query": {
        "filtered": {
            "query": {
                "has_child": {
                    "type": "service",
                    "score_type": "total",
                    "query": {
                        "match_all": {}
                    }
                }
            },
            "filter": {
                "and": [
                    {
                        "terms": {
                            "owk": [
                                23621
                            ]
                        }
                    },
                    {
                        "terms": {
                            "oowk": [
                                23621
                            ]
                        }
                    },
                    {
                        "term": {
                            "ismd": true
                        }
                    },
                    {
                        "and": [
                            {
                                "terms": {
                                    "owk": [
                                        23621
                                    ]
                                }
                            },
                            {
                                "terms": {
                                    "oowk": [
                                        23621
                                    ]
                                }
                            },
                            {
                                "term": {
                                    "ipl": false
                                }
                            },
                            {
                                "terms": {
                                    "pwk": [
                                        21754
                                    ]
                                }
                            },
                            {
                                "range": {
                                    "my": {
                                        "gte": 1980,
                                        "lte": 2015
                                    }
                                }
                            },
                            {
                                "term": {
                                    "isb": false
                                }
                            }
                        ]
                    }
                ]
            }
        }
    },
    "from": 0,
    "size": 0,
    "aggs": {
        "unique": {
            "cardinality": {
                "field": "hhk",
                "precision_threshold": 40000
            }
        }
    }
}


 

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/5539c864-c50c-4ded-8077-bcef3d87deeb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to