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

use trigram tokenizer instead of filter to maintain ordering #5

Merged
merged 1 commit into from
Apr 11, 2018

Conversation

nicpottier
Copy link
Collaborator

@nicpottier nicpottier commented Apr 11, 2018

This switches to using the trigram tokenizer instead of filter.

With the filter, we were turning a single token into three tokens, all with position of 0.

With the tokenizer, each trigram has a position (starting at 0), which then lets us use a phrase query to match not just the presence but ordering of the trigrams, which is what we need.

Added a test to demonstrate.

@nicpottier nicpottier requested a review from dodobas April 11, 2018 19:07
@codecov-io
Copy link

codecov-io commented Apr 11, 2018

Codecov Report

Merging #5 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #5   +/-   ##
=======================================
  Coverage   83.33%   83.33%           
=======================================
  Files           1        1           
  Lines         144      144           
=======================================
  Hits          120      120           
  Misses         12       12           
  Partials       12       12
Impacted Files Coverage Δ
indexer.go 83.33% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2236db8...e1d7b53. Read the comment docs.

@nicpottier
Copy link
Collaborator Author

merging so I can start rebuilds

@nicpottier nicpottier merged commit a034663 into master Apr 11, 2018
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

Successfully merging this pull request may close these issues.

2 participants