Filter By Boolean returns no result

I must be missing something. I have:

const requestOptions = {
  hitsPerPage: 10,
  queryLanguages: ["en"],
  removeStopWords: true,
  filters: `accepting_orders:true`,
};

index.search(searchQuery, {
  ...requestOptions,
  aroundLatLng: `${region.latitude}, ${region.longitude}`,
  aroundRadius: radius,
})
.then(({ hits }) => {
  console.log("Algolia hits", hits);
});

When I remove filters: accepting_orders:true I indeed get 10 results, adding the filter returns an empty array.

My records look something like this:

objectID: "asdasdasdasdasdasd"
name: "My Restaurant"
accepting_orders: true
phone_number: "(555) 555-5555"
_geoloc: { lat: "34.178953", lng: "-118.309509" }

Am I supposed to add something to the dashboard to enable filtering by the accepting_orders boolean?

Didn’t hear back, but it looks like you need to add the field as a facet for this to work.

Glad to see you were able to solve this one. If you do have any questions that you don’t get a response to here please feel free to open a ticket with us as well.

1 Like

@jordan.kasper quick question - I just posted on StackOverflow another question I have. Do you guys like that or dislike that? Do you have a preference where you want us to post questions? I can move the question to your discord forum if you prefer.

For best response rate from us I would suggest posting it here or opening a ticket with us. We try to get to questions no our discord as quickly as possible. Please feel free to post them on StackOverflow as well, more visibility never hurts!

1 Like

ok, created it on this forum as well :slight_smile: