Node.js Implementation of Search not working


I followed this article, and it looks like it works, except I can’t specify any attributes without Algolia returning empty results.

When I run:"RESULTS", {
    query: "best",
    page: 0,
    hitsPerPage: 10,
    facets: "username",
    facetFilters: "username:john",

I’m expecting a few results, and I can confirm this since I have a working Algolia search client on my front end, but this is on my backend.

I want to search for any results where “username” equals “john”. I’ve already done all the configuration on the Algolia dashboard, and like i said, works perfectly on my front end app.

I know the API keys are also correct, because I removed all the attributes and I did get some results, but I only want filtered results using facets.

What am doing wrong?

For some context, this is what my React app looks like:

            query: `${query}`

And it works as expected.

Thanks in advanced!

Hi @focushero

Sorry for the late response – is this still an issue? Can you maybe show the payload from the front end and back end searches?

I notice a coupe things in your backend search –

  1. You have the query hardcoded as “best” – should that return results?
  2. You are using both facetsparameter and afacetFiltersparameter.facetsis used for searching [within facet attributes](, whilefacetFilters` is used at search time to retrieve records.

Try removing the facets parameter and confirm the query “best” should actually return records.