Search code examples
google-cloud-firestorealgolia

Why are Algolia search filters not returning expected results?


I have an index with the following object (there is currently only one object in the index):

object

I do not have any searchable attributes configured, because I will always be passing an empty query when searching this index. I have both createdon and referenceid set as attributesForFaceting, with both set to the "not searchable" option.

When using the below filter, I get no results.

createdon > 1639277337811 AND (referenceid:1MXSmeYJDFDeo7P57gAz OR referenceid:0HpSqhb4OrZR4M0pC9IextLfDcA3 OR referenceid:2owRr1davxRMuIJDR8OzYJV9oBV2 OR referenceid:IP3PYQWl3oVJZtk3wPdezR1cCc43 OR referenceid:Qf5ecisVU0hMzJjS14GG06mXeco1 OR referenceid:WotgE0eR2pPufOwuB6WotJ8lDcm1 OR referenceid:Z0ruWTWcHFPG57AQc0KpOVErw4L2 OR referenceid:bsQHBKBncrMZWZpdG3SFxfbW1Um2 OR referenceid:m1wSTiquI8bwllVgdy4kAumZE0a2 OR referenceid:yhindpmBVAhL68TOScY7hguKf992)

When trying to debug, I have also tried this in the advanced search options of the Algolia console. referenceid:1MXSmeYJDFDeo7P57gAz OR referenceid:111S which also yields no results.

My current theory is that Algolia is requiring all referenceids to be in the index for the search to succeed. Can anyone confirm that this is the case? And if so, is there any way I can include values in the filters that may not exist in the index at the time of the query?


Solution

  • Marking this question as complete. The solution to my issue ended up being creating a new index, taking special care to only change the configuration required.