Empty searches in analytics

Hi there,

This might be a noobish question, but is there anyway to make the Instantsearch.js fire when someone is actively writing in the search field, rather than on page load?

This is what I have in my algolia-search.js atm.

const search = instantsearch({
    indexName: 'dev_Networks',
    searchClient,
    routing: true,
  });

  search.addWidgets([
    instantsearch.widgets.configure({
      hitsPerPage: 42,
    })
  ]);

  search.addWidgets([
    instantsearch.widgets.searchBox({
      container: '#search-box',
      placeholder: 'Find a network..',
    })
  ]);
  /* 
    Stats widget => shows the number of Hits for users get a quick overview 
    */
  search.addWidgets([
    instantsearch.widgets.refinementList ({
      container: '#refinement-list',
      attribute: 'categories',
    })
  ]);

  search.addWidgets([
    instantsearch.widgets.currentRefinements({
      container: '#current-refinements',
      includedAttributes: ['categories'],
    })
  ]);
  
  search.addWidgets([
    instantsearch.widgets.hits({
      container: '#hits',
      templates: {
        item: `
        <article>
          <a href="{{linkUrl}}">
          <div class="img-wrap">
            <img src="{{imgUrl}}" >
          </div>
          <div class="inner-text">
            <h3>{{#helpers.highlight}}{ "attribute": "title" }{{/helpers.highlight}}</h3>
            <p>{{#helpers.highlight}}{ "attribute": "desc" }{{/helpers.highlight}}</p>
          </div>
          </a>
        </article>
        `,
        empty: `We didn't find any results for the search <em>"{{query}}"</em>`,
      },
    })
  ]);
  
  search.start();

Right now empty searches are a 97% of my total searches, and i’m pretty sure its using up my credits.

Again, I realize that this might seem a bit noobish, please bear with me :slight_smile:

Best,

Hi! There are some suggestions on handling this in the docs:

Hopefully that helps.