I'm looking at adding mix-max price sliders to our search instance and need to find out the mix and max price available for the initial query.
In Elasticsearch I have the min, max, and stat aggregations that allow me to pre-fetch this data before filtering. Can't find anything similar for Swiftype?
Note: Our catalogue is pretty large and the prices range from pennies to thousands, due to this I can't make a best guess at min and max.
If you're not concerned so much about exact precision and you have some reasonable estimates for upper and lower bounds, you could use a Range Facet to determine the min and max in a single query.
You'd need to iterate through the resulting facets and look at the first and last facet with count > 0. You could then use the "from" value of the first matching facet as the min, and the "to" value of the last matching facet as the max.
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.