Filter only returns less results results than same filter combined with a must match query

I am struggling to understand why a filter only returns older results than
that same filter combined with a must match query.

More specifically, a prefix filter on a field which contains a link will
return items which are two days old. However, that same filter added with a
must match query will return more recent recent results, and whose link
should fit in the prefix filter. In terms of recency, I am doing a Gaussian
filter on the date for both ES requests. Both requests and their diff are
below.

I am very confused so any hint will help, thanks.

Chris.

P.S.: Both queries are generated using elasticsearch_dsl-py and
bungiesearch (a Django helper for ES_dsl-py of which I am the maintainer).

Here is the query which returns more recent results:
{
"query" : {
"filtered" : {
"filter" : {
"bool" : {
"must" : [
{
"or" : {
"filters" : [ {
"term" : {
"blacklisted" : False
}
}, {
"missing" : {
"field" : "blacklisted"
}
} ]
}
},
{
"or" : {
"filters" : [ {
"term" : {
"is_duplicate" : False
}
}, {
"missing" : {
"field" : "is_duplicate"
}
} ]
}
},
{
"or" : {
"filters" : [
{
"terms" : {
"publication_name" : []
}
},
{
"prefix" : {
"link" :
"http://www.ncbi.nlm.nih.gov/pubmed/"
}
} ]
}
} ]
}
},
"query" : {
"bool" : {
"must" : [ {
"match" : {
"_all" : {
"operator" : "and",
"query" : "cancer"
}
}
}, {
"function_score" : {
"score_mode" : "sum",
"boost" : 20,
"functions" : [ {
"gauss" : {
"published" : {
"origin" : "2015-04-08",
"decay" : 0.95,
"scale" : "15d",
"offset" : "4d"
}
}
} ],
"boost_mode" : "multiply"
}
} ]
}
}
}
},
"fields" : "_source"
}

Here is the query which returns the older results:
{
"query" : {
"filtered" : {
"filter" : {
"bool" : {
"must" : [
{
"or" : {
"filters" : [ {
"term" : {
"blacklisted" : False
}
}, {
"missing" : {
"field" : "blacklisted"
}
} ]
}
},
{
"or" : {
"filters" : [ {
"term" : {
"is_duplicate" : False
}
}, {
"missing" : {
"field" : "is_duplicate"
}
} ]
}
},
{
"or" : {
"filters" : [
{
"terms" : {
"publication_name" : []
}
},
{
"prefix" : {
"link" :
"http://www.ncbi.nlm.nih.gov/pubmed/"
}
} ]
}
} ]
}
},
"query" : {
"function_score" : {
"score_mode" : "sum",
"boost" : 20,
"functions" : [ {
"gauss" : {
"published" : {
"origin" : "2015-04-08",
"decay" : 0.95,
"scale" : "15d",
"offset" : "4d"
}
}
} ],
"boost_mode" : "multiply"
}
}
}
},
"fields" : "_source"
}

Here is the diff between both JSON:
51,56c51,60
< "bool" : {
< "must" : [ {
< "match" : {
< "_all" : {
< "operator"
: "and",
< "query" :
"cancer"

                          "function_score" : {
                                  "score_mode" : "sum",
                                  "boost" : 20,
                                  "functions" : [ {
                                          "gauss" : {
                                                  "published" : {
                                                          "origin" : 

"2015-04-08",

                                                          "decay" : 

0.95,

                                                          "scale" : 

"15d",

                                                          "offset" : 

"4d"
59,75c63,64
< }, {
< "function_score" : {
< "score_mode" :
"sum",
< "boost" : 20,
< "functions" : [ {
< "gauss" : {
<
"published" : {
<
"origin" : "2015-04-08",
<
"decay" : 0.95,
<
"scale" : "15d",
<
"offset" : "4d"
< }
< }
< } ],
< "boost_mode" :
"multiply"
< }
< } ]

                                  } ],
                                  "boost_mode" : "multiply"

--
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/b3d6488d-9c13-48ba-ab0a-02df76d8e2f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.