Filtering on a Function Score Element (Not filtering as expected)

Hey Guys,

I have a question to put on you guys again.. :slight_smile:

in the query below I have a nested query element with a function score...
BUT... it doesnt appear to be filtering based on that function like I had
hoped....

any thoughts?

{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"and": [
{
"terms": {
"owk": [
23621
]
}
},
{
"terms": {
"oowk": [
23621
]
}
},
{
"term": {
"ismd": true
}
},
{
"and": [
{
"and": [

                       {
                          "term": {
                             "ipl": false
                          }
                       },
                       {
                          "terms": {
                             "pwk": [
                                21754
                             ]
                          }
                       },
                       {
                          "range": {
                             "lsdt": {
                                "gte": "2014-09-20",
                                "lte": "2014-09-30"
                             }
                          }
                       },
                       {
                          "term": {
                             "isb": false
                          }
                       }
                    ]
                 },
                 {
                    "query": {
                        
                       "function_score": {
                          "boost_mode": "multiply",
                          "functions": [
                             {
                                "script_score": {
                                   "params": {
                                      "min_value": 2,
                                      "max_value": 2
                                   },
                                   "script": "(max_value == null || 

_score <= max_value) && (min_value == null || _score >= min_value)?1:-1"
}
}
],
"query": {
"filtered": {
"query": {
"has_child": {
"type": "service",
"score_type": "total",
"query": {
"filtered": {
"filter": {
"and": [
{
"terms": {
"owk": [
23621
]
}
},
{
"range": {
"dt": {
"gte":
"2014-09-20",
"lte":
"2014-09-30"
}
}
}
]
}
}
}
}
},
"filter": {
"terms": {
"owk": [
23621
]
}
}
}
}
}
}
}
]
}
]
}
}
},
"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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/67a55e78-15ff-4616-a637-e565de30cb9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

So my expected results would for the results that the results from the
function_score filter would filter out results where the parent had n
number of children... but instead, I'm getting all the results instead of a
filtered set....

I could really use some advice here... Or let me know what more I can
provide that would get results?

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/72caea25-560e-4e33-b229-93d6e1aea7a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.