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

BUG: WP_User_Query Search returns more results than expected #60

Open
burhandodhy opened this issue Oct 10, 2022 · 3 comments
Open

BUG: WP_User_Query Search returns more results than expected #60

burhandodhy opened this issue Oct 10, 2022 · 3 comments
Labels
bug Something isn't working module:users

Comments

@burhandodhy
Copy link
Contributor

burhandodhy commented Oct 10, 2022

Describe the bug

WP_User_Query Search returns more results than expectation when we search for the user email. For example when I search for [email protected], ElasticPress also returns all the user those have gmail.com account

For example

Steps to Reproduce

  1. Create multiple users.
  2. Use WP_User_Query and search against any email address.
  3. EP returns more user than expectation.
@burhandodhy burhandodhy added the bug Something isn't working label Oct 10, 2022
@ws256
Copy link

ws256 commented Oct 26, 2022

Hello!
That's right, full-text search, the word gmail is everywhere.

  1. read BUG: WP_User_Query orderby #62
  2. use sorting by relevance

@felipeelia felipeelia transferred this issue from 10up/ElasticPress Mar 2, 2023
@felipeelia
Copy link
Member

We could store two fields for emails, one with the full email and another with its pieces (user, domain, etc.), so we could search through them separately. As that would require a change in the mapping, I'd prefer a smaller change that would fulfill our needs in this issue, but that could the fallback we need.

@ws256
Copy link

ws256 commented Feb 5, 2025

@felipeelia Bad idea. Example, there is a login field, I have many users: user-8806019, user-0511554, etc. The search does not work because it splits the word by the hyphen. The results contain many thousands of matches for "user" value.
Imagine how many variations there are in how to write an email address.
Because of this, it was not possible to use the plugin in the admin panel to search for users.
Need to configure Fuzziness for the fields. Or use some other parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module:users
Projects
None yet
Development

No branches or pull requests

3 participants