Range facet seems a little different from what i understand

for example:
{
"query" : {
"match_all" : {}
},
"facets" : {
"range1" : {
"range" : {
"field" : "age",
"ranges" : [
{ "from" : 1, "to" : 10 }
]
}
}
}
}
I want to range [1, 10] on age field, but es returns results in [1, 10),
not including the upper bound.

--

That's how range facet actually works. It includes the lower bound
and excludes the upper bound. If all you need is count for one range, you
can filter facet with a range filter, that has more
flexibility. Alternatively, if age is integer or long field, you can use
something like 10.1 as a upper boundary.

On Tuesday, December 11, 2012 4:20:41 AM UTC-5, asoqa wrote:

for example:
{
"query" : {
"match_all" : {}
},
"facets" : {
"range1" : {
"range" : {
"field" : "age",
"ranges" : [
{ "from" : 1, "to" : 10 }
]
}
}
}
}
I want to range [1, 10] on age field, but es returns results in [1, 10),
not including the upper bound.

--

thanks , i see

在 2012年12月14日星期五UTC+8上午5时11分18秒,Igor Motov写道:

That's how range facet actually works. It includes the lower bound
and excludes the upper bound. If all you need is count for one range, you
can filter facet with a range filter, that has more
flexibility. Alternatively, if age is integer or long field, you can use
something like 10.1 as a upper boundary.

On Tuesday, December 11, 2012 4:20:41 AM UTC-5, asoqa wrote:

for example:
{
"query" : {
"match_all" : {}
},
"facets" : {
"range1" : {
"range" : {
"field" : "age",
"ranges" : [
{ "from" : 1, "to" : 10 }
]
}
}
}
}
I want to range [1, 10] on age field, but es returns results in [1, 10),
not including the upper bound.

--