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.
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.