Strategy for updating fields that change with time #424
Replies: 6 comments 6 replies
-
Hello @matteocontrini! 👋 Yes, this is the right place! You are not missing something, today It may be costly if only this field is updated very often. Do you only have to index this field afterward? How often? Did you tested it to measure costs? At some point, we thought of having fields as part of meta-data that could be quickly indexed (bypassing most of the structures used in the search). What is the purpose of this field in your use case? Thanks! PS: Thanks for the 404. It's now fixed 🙏 |
Beta Was this translation helpful? Give feedback.
-
@matteocontrini any solution for your problem? i have a similar issue. I have 200k documents that have a "order" field that is updated in every one document each one hour, to shuffle my content. Are there a solution for that without reindex the entere collection of documents every hour? |
Beta Was this translation helpful? Give feedback.
-
Hey @mvaisberg and @matteocontrini 👋 We've implemented a differential indexing mechanism, and based on a test case around the use case mentioned here, we've had some significant improvements in the indexing speed. It should be coming in v1.6! We'll also be working on an API for updating a document-matched set from a query in the future. |
Beta Was this translation helpful? Give feedback.
-
Just to add another use case here. We've also got an index with just under 100k documents (and growing rapidly). Each document contains tags, authors and category objects that can each be individually updated as well. The individual attributes themselves also contain a url and name that can change from time to time. For now we are happy to re-index all documents and this doesn't seem to take more than 30 minutes but am wondering if there is a better way to accomplish this and minimize CPU/RAM impact? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hey @gmourier, very much appreciate you taking a look at this and for the added tips! We are currently working on something similar to #1 but instead of querying Meilisearch we are determining what documents need to be updated on our end and performing a mass re-index on those documents. We were fortunate to have some methods in place that let us know affected/associated documents each time the targeted attributes are update. Our hope is to use the updateDocuments() method on the PHP wrapper. I believe under the hood this is using the mentioned AddOrUpdateDocuments. I took a brief look at the Rhai function from @Kerollmops and this seems like a great idea for certain type of document updates. Looking forward to testing this locally at some point to see results. One immediate feedback would be the ease of adoption and learning curve associated with it and wonder if you have plans to include a more standard API at some point. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hey @gmourier really thanks for your support. My case have not sense update documents because i change all of them. I have a "sort_order" number that change every hour for all documents so i have to reindex all every hour. I will try to update the meilisearch version to check if the reindex time improve. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
In my use case I need to index a collection of posts of an online forum (it's about 600k posts). One of the fields I'd like to add and use for ranking is whether the author of the post is an "expert" user with good reputation, something I already have in my database.
However this reputation score (which could really be just a boolean in its simplest form) obviously changes with time. While experimenting with Meilisearch I've added this reputation score as a field of each post document, however it is my understanding that it's not possible to then update this field value in batch, so updating it would mean re-creating the whole index or updating all the posts of a user every time its "reputation" changes, which is probably quite expensive.
Is there something I'm missing? Will the future support for multi-index searches help with this?
Thank you!
P.S. I hope this is the right place to ask, I don't see a "support" category
P.P.S. the page where I'm writing this thing has a Support link in the sidebar which brings to a 404
Beta Was this translation helpful? Give feedback.
All reactions