Completely refactor the fulltext operations#1093
Merged
joka921 merged 162 commits intoad-freiburg:masterfrom Jan 18, 2024
Merged
Completely refactor the fulltext operations#1093joka921 merged 162 commits intoad-freiburg:masterfrom
joka921 merged 162 commits intoad-freiburg:masterfrom
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. |
joka921
reviewed
Jan 10, 2024
Member
joka921
left a comment
There was a problem hiding this comment.
A second round of reviews, this is already much much much cleaner.
|
joka921
approved these changes
Jan 18, 2024
Member
joka921
left a comment
There was a problem hiding this comment.
Thank you very much,
This makes the text index code much much cleaner.
hannahbast
pushed a commit
that referenced
this pull request
Jan 23, 2024
) 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.
This file contains hidden or 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
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.

As of this commit, the fulltext index (triggered by
ql:contains-wordandql: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-entityand 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-wordtriple, aTextIndexScanForWordis created.ql:contains-entitytriple, aTextIndexScanForEntityis created.This is much cleaner than the old
TextOperationWith[out]Filteroperations 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.