Return a count for a numeric query, similar to the ais-refinement-list

Hi there,

How do I get the number of hits from a numeric filter using Vue Instant Search?

I have an instant search instance:

<ais-instant-search :search-client="searchClient" index-name="pages">
          <ais-configure :numeric-filters.camel="numericFilters">

With numericFilters returning either [] or ['time > 10000000']. It does this with a checkbox:

<input type="checkbox" v-model="showNewPosts" id="show-new-posts" />
<label for="show-new-posts">New posts (X)</label>

And a computed property that changes when showNewPosts is ticked.

The designs have the checkbox above an ais-refinement-list, so in order to make this match with them, I’d like to have brackets next to the label with the number of results if it is checked:

  • New posts (3)
  • Science (5)
  • Sports (7)

Hey! Can you please reproduce what you currently have in this Vue InstantSearch sandbox? It’ll make it easier to understand what you’ve tried already.