How to search multiple Indices in nodejs

I have a nodejs api that returns algolias search results. It’s the function provided in the docs:

const index = AlgoliaClient.initIndex('index');
index
  .search(q)
  .then(({ hits }) => {
      res.send(hits);
  })
  .catch((err) => {
    console.log(err);
  });

The problem is I have 2 indices that I want to search through. I’ve looked through the docs but I could only find a solution for InstantSearch. How could I search through multiple instances in nodejs?

Hi @user01, I believe this is what you are looking for. If you don’t want to search at the same time, you can initIndex with two different indices, using different variables names.