-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add filter to meilisearch in backend #530
Conversation
Tested and it work for simple cases, what does not work is mostly due to our current implementation of meilisearch syncing. Enums are stored as integer and not string values so comparisons fail |
35226d5
to
084ef0d
Compare
@zoriya I've updated the sync code to send enums as strings and Now I have a few questions:
|
Great job!
|
|
Yeah, I think doing that as part of the current migration process would be the easiest. Meilisearch works with upserts so we could just do something like:
After the discussion in #480, I want to rework migrations, but I don't think this will be done soon. Let's just use it inside the migration container for now (this would require adding meilisearch as a dependency of the migration container in Metadata refreshes also updates meilisearch, so the database can't drift too much. I'm fine not solving the drift issue if meili was unavailable during a db update for now. |
Ah yep, that would probably work. Meilisearch should be available when the migration is running as it doesn't depend on anything else? I could look into it later. How often does the metadata refresh? |
Depend on the air date of the item. Here is the snipet responsible for calculating the next refresh date: public static DateTime ComputeNextRefreshDate(DateOnly airDate)
{
int days = DateOnly.FromDateTime(DateTime.UtcNow).DayNumber - airDate.DayNumber;
return days switch
{
<= 4 => DateTime.UtcNow.AddDays(1),
<= 21 => DateTime.UtcNow.AddDays(14),
_ => DateTime.UtcNow.AddMonths(2)
};
} |
@zoriya This is ready for another review when you have some time 🙏 |
Apart from the escaping issue, it looks good. Do you want me to add the meilisearch's migration, or do I leave that to you? |
What migration are you talking about? Adding a database migration which updates all documents in meilisearch? |
Yes |
Required if we want to seamlessly add filtering to the browse page. Otherwise filtering won't work when users use the Search bar.
I've now tested this and it seems to work with enums (
genres
) and dates (airDate
,startAir
,endAir
).