Max Price for index

Hey there!

Im developing a slider to show min/max price for instantsearch (using the vue components you guys built, amazing job with those btw!) and to make the slider work I need to set a max price.

I have seen other implementations of this using the regular JS implementation this way

algoliaHelper.on('result', function (content, state) {
    var facetResult = content.getFacetByName(facetName);
    console.log(facetResult.stats.max);
});

Once I saw this I assumed that the same stats data would be kept in the stats vue component but unfortunately the only items exposed in the the stats component are query, totalResults and processingTime

I have scoured the searchStore but cant find the relevant information in there.

Can anyone guide me to how I can get the highest price value of an algolia index?

Thanks for taking the time to read this!

Hey @chris4,

We will expose the full Algolia response in order for you to be able to do this.

Please subscribe to the issue here: https://github.com/algolia/vue-instantsearch/issues/316

Thanks for pushing this forward,
Cheers,

1 Like

@chris4, did you try leveraging the getFacetStats(attributeName) method available on the search store?

Thanks @rayrutjes for the guidance. I have subbed to the github issue and will look into the getFacetStats now!