-
Notifications
You must be signed in to change notification settings - Fork 41
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
Completely refactor the fulltext operations #1093
Conversation
This reverts commit a91a811.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1093 +/- ##
==========================================
+ Coverage 84.34% 85.25% +0.90%
==========================================
Files 304 308 +4
Lines 29100 29385 +285
Branches 3446 3464 +18
==========================================
+ Hits 24544 25051 +507
+ Misses 3153 2938 -215
+ Partials 1403 1396 -7 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A second round of reviews, this is already much much much cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly very minor stuff.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much,
This makes the text index code much much cleaner.
) Since #1093 we use a much simpler approach for answering full-text queries that contain `ql:contains-word` and `ql:contains-entity`. That PR made a lot of old code for the text index obsolete. This code is now deleted.
As of this commit, the fulltext index (triggered by
ql:contains-word
andql:contains-entity
) uses two basic operations:TextIndexScanForWord
: For a given word or prefix, return all text records that contain the word, (possibly together with the matched word in the case of a prefix, and the score of the match).TextIndexScanForEntity
: For a given word or prefix, return a superset of all pairs of(text, entity)
where the entity is contained in the text according toql:contains-entity
and the text contains theword
. For technical reasons this is a superset: We always have to scan the complete block from the half-inverted index which might belong to a shorter prefix.The general processing is then as follows:
ql:contains-word
triple, aTextIndexScanForWord
is created.ql:contains-entity
triple, aTextIndexScanForEntity
is created.This is much cleaner than the old
TextOperationWith[out]Filter
operations which combined the functionality of the above scan operations with JOIN operations, because the old approach lead to a lot of code duplication (the code for a join of two tables was duplicated for the fulltext module) and because the new approach makes queries easier to optimize and to reason about because the runtime information trees become much clearer if the scans and joins are represented separately.