Skip to content
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

Extend ep_user_query_db_args filter #117

Open
1 task done
yarovikov opened this issue Dec 31, 2024 · 2 comments
Open
1 task done

Extend ep_user_query_db_args filter #117

yarovikov opened this issue Dec 31, 2024 · 2 comments
Milestone

Comments

@yarovikov
Copy link

Is your enhancement related to a problem? Please describe.

Hi there.

Is it possible to add WHERE ID IN ($placeholders) for SQL Query here depends on args (ep_user_query_db_args filter)?

https://github.com/10up/ElasticPressLabs/blob/develop/includes/classes/Indexable/User/User.php#L647-L653

The problem is i'v got > 1 000 000 users, but i need only 10k in the index based on some postmeta value. Each time a full indexing is performed, it takes several hours 😅

Designs

No response

Describe alternatives you've considered

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@felipeelia
Copy link
Member

We could introduce two filters there: one to short-circuit the entire function if people already know the IDs they need and another to filter the SQL query directly.

@felipeelia felipeelia added this to the 2.4.0 milestone Feb 7, 2025
@yarovikov
Copy link
Author

@felipeelia sound good. actually currently i don't need that because i use full index to get count of each role. But i think this would like useful option in the feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants