-
Notifications
You must be signed in to change notification settings - Fork 52
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
ql:contains-word now can show the respective word score #1397
base: master
Are you sure you want to change the base?
Conversation
modified: src/index/IndexImpl.Text.cpp modified: test/QueryPlannerTestHelpers.h modified: test/engine/TextIndexScanForWordTest.cpp Problems: |
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.
This already looks very nice, I only have a few comments, but the most things we have already discussed today.
smallIdTable.resize(idTable.numRows()); | ||
std::ranges::copy(idTable.getColumn(0), smallIdTable.getColumn(0).begin()); | ||
std::ranges::copy(idTable.getColumn(2), smallIdTable.getColumn(1).begin()); |
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.
I think we don't need to copy all the columns...
The IdTable class has a function setColumnSubset
which can be used to do this more efficiently(stripping columns works well with column based layouts).
@@ -1279,6 +1279,7 @@ void Visitor::setMatchingWordAndScoreVisibleIfPresent( | |||
} | |||
for (std::string_view s : std::vector<std::string>( | |||
absl::StrSplit(name.substr(1, name.size() - 2), ' '))) { | |||
addVisibleVariable(var->getScoreVariable(std::string(s))); |
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.
Don't forget to drop the std::string(...)
again once you have a dedicated function for the getWordScoreVariable
.
And rename the getScoreVariable
to getEntityScoreVariable
or something.
|
||
result = s2.computeResultOnlyForTesting(); | ||
ASSERT_EQ(result.idTable().numColumns(), 1); | ||
ASSERT_EQ(result.idTable().numColumns(), 2); |
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.
As discussed, let the getQec()
function take the contents of a ContextFile
. Then we can finally properly test the test index.
Quality Gate passedIssues Measures |
…adapted unit tests. Missing e2e tests.
Commit doesn't contain all changes necessary for pull request yet.
…x. This is done through passing the words and docsfile as string, and then building the text index as normal. Basic Test is existent (TODO make more edge case tests) and e2e testing is fixed.
modified: src/engine/TextIndexScanForWord.cpp
Updated computeVariableToColumnMap to get a variable for word score
Updated getResultWidth which now is one column wider
modified: src/index/FTSAlgorithms.cpp
Updated now filters a table with 3 instead of 2 columns
TODO generalize to a table with arbitrary amount of columns (also use views::zip once c++23 is in use)
modified: src/index/IndexImpl.Text.cpp
Updated readWordCl to read the frequency compressed list for scores and add an extra column for them before returning the table
modified: src/parser/sparqlParser/SparqlQleverVisitor.cpp
Updated setMatchingWordAndScoreVisibleIfPresent to add the score variables for words when implicitly asked for with *