On a field query where my document contains a collection of samples, each
with a collection time, I only want to count the number of samples where
the collection time is between a pair of dates. The goal is to return an
accurate number of collected samples within a time range. Will using a
Range Facet do the trick?
The website states:
*
*
"The range facet support also providing the range as string formatted
dates."
Does this mean that the Java API supports something like this on field
searches:
As far as I remember it, you can write something like:
RangeFacetBuilder sampleRange = FacetBuilders.rangeFacet( "sampleTimeRange" )
.field( "samples.collected" )
.addRange("2013-01-01", "2014" );
That said, if you need only one range, you perhaps don't need facet at all but only use the _count API and apply a RangeFilter.
On a field query where my document contains a collection of samples, each with a collection time, I only want to count the number of samples where the collection time is between a pair of dates. The goal is to return an accurate number of collected samples within a time range. Will using a Range Facet do the trick?
The website states:
"The range facet support also providing the range as string formatted dates."
Does this mean that the Java API supports something like this on field searches:
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.