Facet not being returned from query - InstantSearch

I have a very simple InstantSearch created and I just noticed that not all of my defined facets are being returned from the query. When I use the web interface at algolia.com my facet is returned displays correctly. However, on my dev page not all facets are not present even though they’re being requested.

Request URL:

https://9g2rukppge-dsn.algolia.net/1/indexes/*/queries?x-algolia-agent=Algolia%20for%20vanilla%20JavaScript%20(lite)%203.27.0%3Binstantsearch.js%202.10.2%3BJS%20Helper%202.26.0&x-algolia-application-id=9G2RUKPPGE&x-algolia-api-key=8860a74c330efaf0119818fcdd800126

Query String Parameters:

x-algolia-agent=Algolia%20for%20vanilla%20JavaScript%20(lite)%203.27.0%3Binstantsearch.js%202.10.2%3BJS%20Helper%202.26.0&x-algolia-application-id=9G2RUKPPGE&x-algolia-api-key=8860a74c330efaf0119818fcdd800126

Form Data:

{"requests":[{"indexName":"SPR","params":"query=br6340&hitsPerPage=30&maxValuesPerFacet=100&page=0&facets=%5B%22material.description%22%2C%22outsideDiameter.description%22%2C%22profile.description%22%2C%22unitOfMeasurement.description%22%2C%22measurement.description%22%2C%22finish.description%22%2C%22screwSize.description%22%5D&tagFilters="}]}

I can see that screwSize.description is being passed as a facet but it’s not being returned.

Any suggestions on why?

Here is a JSFiddle for review.

Hi @jnichols,

Thanks for the fiddle. Always helpful.

With our access to just the Search API Key, I can’t see the settings of the SPR index.

Could you check/confirm a few things for screwSize.description?

  • set as an attribute for faceting
  • not set as filterOnly(screwSize.description), this makes it usable as a filter, but not as a facet with counts
  • if still an issue, post the results of getSettings to this thread, this requires the Admin API key so we could not check ourselves

Thanks and let us know what you find!

PS - In the JSFiddle the desired facet is listed as “screw.description” instead of “screwSize.description”, but I don’t think that is the issue :slight_smile:

1 Like

@ajay.david,

I took your last suggestion as the first thing for me to check.

PS - In the JSFiddle the desired facet is listed as “screw.description” instead of “screwSize.description”, but I don’t think that is the issue :slight_smile:

That seemed like a stupid mistake that I could make. Sure enough, it was. I corrected the attribute name and things worked as desired.

1 Like