Date range filter

Hi everyone,

I am new to Elasticsearch, and the scenario that I am facing is that I am
trying to build a dynamic filter (using C# NEST client). The user will use
a slider to select an integer for example between 1 and 20 to denote the
number of years experience someone might have. I need to use this number
say 'n' to figure out which people should be in the result set. Everything
is working fine, this is just the last piece of the puzzle.

I have the following mapping (array of workhistory objects =>
WorkHistories);

"WorkHistories" :
{
"properties" :
{
"Employer" :
{
"type" : "string"
},
"EndDate" :
{
"type" : "date",
"format" : "dateOptionalTime" },
"JobTitle" :
{
"type" : "string"
},
"StartDate" :
{
"type" : "date",
"format" : "dateOptionalTime"
}
}
}

Here is the pseudo code for what I am trying to achieve. I had a look at
MVEL, but I am not sure if this is the correct option to pursue? How can
this be achieved using filters, ignoring the fact that this is done using
NEST.

totalExperience = 0;
foreach experience in workhistories
begin
totalExperience += datediff(experience.endDate - experience.startDate)
end

return totalExperience >= 'n'

Any help or guidance will be greatly appreciated.
Thanks

--
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.
For more options, visit https://groups.google.com/groups/opt_out.