Hi!
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:
client.search("RESULTS", {
query: "best",
page: 0,
hitsPerPage: 10,
facets: "username",
facetFilters: "username:john",
})
.then(
console.log
)
.catch(
console.log
);
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:
<SearchContainer>
<InstantSearch
searchClient={searchClient}
indexName="RESULTS"
searchState={{
query: `${query}`
}}
>
<RefinementList
attribute={"username"}
defaultRefinement={["john"]}
/>
And it works as expected.
Thanks in advanced!