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

Tweak search algorithm for more relevant results #508

Merged
merged 5 commits into from
May 25, 2016

Conversation

tlovett1
Copy link
Member

@tlovett1 tlovett1 commented May 13, 2016

This PR is not ready for merge but rather review. @allan23 @ChrisWiegman @lukaspawlik @dkotter @AaronHolbrook

Here are the proposed changes:

  1. Decrease fuzzy clause fuzziness to 1 from 2. With a fuzziness of 2, the word yell matches yeti since they are two levenshtein changes apart. The point of fuzziness is to account for misspellings which 1 does for the most part. 2 is resulting in way too many bad results.
  2. Add operator => 'and' to multi_match clause. Right now any document containing ANY of the search terms returns a match with a 2x boost. Let's only give the 2x boost to docs that contain ALL the terms.
  3. Finally, add a multi_match query of type phrase. This clause gives a 4x boost to documents containing the terms exactly as is in the EXACT order.

P.S. If anyone wants a cool project, we need a way to unit test relevancy accuracy.

@tlovett1
Copy link
Member Author

Also, please review/test this for merging into core: https://github.com/10up/elasticpress-weight-recent

@ChrisWiegman
Copy link
Contributor

The search tweaks here look good (we've actually had to filter fuzziness down to one on client sites for the same reasons as you state above).

Tested with wp_test content and a bit more and it all seems a bit more accurate now with this new tweak (I can actually find my last name mispelled "Weigman" without issue). I think this is fine to merge to core when you're ready.

@tlovett1 tlovett1 added this to the 2.0 milestone May 25, 2016
@tlovett1 tlovett1 merged commit 26f2147 into develop May 25, 2016
@tlovett1 tlovett1 deleted the feature/amazing-search-algorithm-improvements branch February 10, 2017 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants