-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
bug: PHP lex_stats call shouldn't return entire entries list #1775
Comments
It's rather hard to construct a Mongo query for "entries with audio", because:
To construct a Mongo query for audio, we'll need to first build a list of audio writing systems in the project config, then construct a query that checks entry, senses, and examples for those writing systems. (Which could, in theory, appear in any field of the entry, sense, or example). That's not a simple Mongo query to construct. |
It is actually surprisingly difficult to construct a Mongo query for "entries containing audio", and I'm becoming persuaded that it's not worth the effort. I'd rather remove the "entries containing audio" part from the dashboard and replace it with something else, such as "entries with comments" or "entries with TODO status in a comment". The amount of programming effort of the audio feature seems to be outpacing its value to the users. |
You're right - I remember this coming up when Billy was working on developing the dashboard. I think the proper way to implement this is through a "audio count" or "hasAudio" property on the entry for the purpose of querying, and this is maintained as a separate property from the writing system. Of course, this would also require changes to the existing API and a data migration. The cheap way forward, which avoids changes and fixes problems with projects that encounter the 500 error, is to just remove the "entries with audio" stat as you suggested. |
See #1773 (comment) for details. On a project with more than 30,000 entries,
lex_stats
is trying to return all the entries and running out of memory. It should only be returning an entry count, plus a count of how many entries have pictures and how many have audio, both of which would be easy to get with a simple Mongo query.The text was updated successfully, but these errors were encountered: