I'm having difficultly sorting by multiple fields, I want to get results ordered with a mixture of _score and by the date. I want the most matching documents first - then ordered by the date
e.g.
{
{ "name" : "t-shirt", colors : ['red', 'green'], "date" : "2014-06-02" },
{ "name" : "t-shirt", colors : ['red' ], "date" : "2014-06-02" }, // this score less but is more recent
{ "name" : "t-shirt", colors : ['red', 'green'], "date" : "2013-06-20" }, // this score is higher but it is older
{ "name" : "t-shirt", colors : ['red', 'green'], "date" : "2012-06-20" },
}
I've had a look at function_scores and scripts etc but I'm a bit lost - any ideas please?