ElasticPress icon indicating copy to clipboard operation
ElasticPress copied to clipboard

Weighting UserMeta

Open ws256 opened this issue 1 year ago • 0 comments

Describe your question

Hello! I have a question about searching for users. I want to find Jon Snow. first_name = John last_name = Snow When I fulfill the search for "John Snow", I have 10 people in the results:

  1. John Cena
  2. John Cleese
  3. John Daley
  4. John Goodman
  5. John Legend
  6. John Leguizamo
  7. John Mahoney
  8. John Mellencamp
  9. John Rhys-Davies
  10. John Snow

If the request is only one word "Snow", there is only one line "John Snow" in the search results

The question of how to set Last_name more than first_name? How to configure weights for other usermeta fields?

Here are my observations on working with user search. The entire user table is indexed, email, login, settings, system fields. This is wrong, you have to manually exclude all fields through a filter, leaving only the necessary ones. It would be logical to do the same as for posts "Manage Search Fields & Weighting", you need an additional field - added. If you want to change the weight - change it.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

ws256 avatar Jul 01 '24 21:07 ws256