Hi, I’ve searched the forum, but haven’t come across a solution yet.
Problem 1: Multiple conditions in Algolia
Problem 2: Sorting of the results
I want to implement Algolia Search, with the results being displayed in a RG.
The database is very large and for simplicity let’s say there are 3 fields that are critical to the operation
- Category → text (option set)
- Status → “live” or “draft”
- modified date → date
The search results should “simply” display the following:
The first 15 items that fulfill the following condition:
Status = live AND
Category = search term (chosen from a dropdown with the option set)
Sorted by modified date in descending order (i.e. most recently modified first)
I can successfully build the RG for one of the 2 conditions, but I can’t for the life of me figure out how to build it so that both conditions are true.
Also the sorting is giving me a headache, because it appears to me like it is sorting the displayed results correctly, BUT it’s not in fact showing me the actual most recent entries first. Instead it pulls a seemingly random list of results and then sorts that.
My database has over 500k entries, so any search operation will yield way more than the 15 most recent ones, which I’d like to have displayed.
The screenshot shows a successful query for Condition Category = search term, creating a list of 15 results. However these results don’t fulfill condition 2, status=“live”.
Any help for either problem is really appreciated. Thanks!