-
Notifications
You must be signed in to change notification settings - Fork 17
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
Initial implementation of manual ngram-based search in MongoDB #993
Open
ml-evs
wants to merge
5
commits into
main
Choose a base branch
from
ml-evs/mongo-fts-ngram
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ml-evs
changed the title
[WIP] Initial noodling with manual ngram index in MongoDB
[WIP] Initial noodling with manual ngram-based search in MongoDB
Nov 6, 2024
datalab Run #2758
Run Properties:
|
Project |
datalab
|
Branch Review |
ml-evs/mongo-fts-ngram
|
Run status |
Passed #2758
|
Run duration | 06m 27s |
Commit |
b49b764aa7 ℹ️: Merge d4969ae68b137119b765c9651c1e892c747cb8a9 into 700dc5e9fd490ddbe40c0520e42b...
|
Committer | Matthew Evans |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
405
|
View all changes introduced in this branch ↗︎ |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #993 +/- ##
==========================================
+ Coverage 68.49% 68.92% +0.43%
==========================================
Files 62 62
Lines 3955 4026 +71
==========================================
+ Hits 2709 2775 +66
- Misses 1246 1251 +5
|
ml-evs
force-pushed
the
ml-evs/mongo-fts-ngram
branch
from
November 10, 2024 15:43
79b2bcc
to
dbf241f
Compare
ml-evs
changed the title
[WIP] Initial noodling with manual ngram-based search in MongoDB
Initial implementation of manual ngram-based search in MongoDB
Nov 10, 2024
ml-evs
force-pushed
the
ml-evs/mongo-fts-ngram
branch
from
November 10, 2024 15:58
63be944
to
d4969ae
Compare
I think this is ready for review now, though we should not make it the default (yet) until we can test scaling and quality of search results. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #679 -- MongoDB text indexes tokenize using whitespace and punctuation only. This PR investigates whether we can build a manual ngram index, so when searching for refcode
ABCDEF
, you get results if you only ask forABC
,BCD
etc.This is done by making a separate collection called
item_fts
that is used only for this kind of search, by storingimmutable_id
,type
andngrams
for all items, with an index overngrams
. Lookup is then done by ngrammifying the query string and doing array lookup and ordering by the number of matches.Will have to fiddle around to see:
N
is, and whether we need to do all N+1-grams up to a fixed range