alicolville / meal-tracker

Extend your site by allowing your users to track their meals and calorie intake. Calorie targets for the day can be set by admins, the users or automatically pulled from Yeken's Weight Tracker
https://mealtracker.yeken.uk/
1 stars 0 forks source link

Duplicate Food Items #156

Closed sbservices closed 1 year ago

sbservices commented 1 year ago

How do we deal with duplicate food items? There seems to be a huge amount of duplication on the meal tracking after using it for some time. E.g. when searching for 'Banana' we get approx 52 versions with their fractional versions too!

Assuming it is not a bug, does this mean manual cleansing of data constantly, or is there a 'de-duplicate' tool?

alicolville commented 1 year ago

Are you allowing users to search across all user meal collections? If so, then I'm afraid you can't really.

sbservices commented 1 year ago

We turned off the 'allow others to search other users' meal items months ago. The ones that have huge duplicates seem to be the FatSecrets items, would it be anything to do with 'caching' being enabled?

image

The next part of the problem is cleaning the data - if it is the caching, can the cache be flushed, and if its not caching, is it easy enough to export the data in to a spreadsheet and import it back in cleaned up? And would we have to delete all current entries to re-import the data, or can we perform an import that has flags or markers to remove certain items? Can this be done in WP back office, or do we need to edit the database directly at the MySQL level?