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

Magic service query for text search. #1732

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

Flixtastic
Copy link
Contributor

Add the possibility to do text seach with a magic service query. This leads to two new service queries, one for ql:contains-word and one for ql:contains-entity.

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 95.88378% with 17 lines in your changes missing coverage. Please review.

Project coverage is 90.25%. Comparing base (8fe0642) to head (8cd7b94).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/parser/TextSearchQuery.cpp 97.50% 1 Missing and 5 partials ⚠️
src/parser/TextSearchQuery.h 68.75% 0 Missing and 5 partials ⚠️
src/engine/CheckUsePatternTrick.cpp 0.00% 2 Missing ⚠️
src/engine/QueryPlanner.cpp 93.33% 0 Missing and 1 partial ⚠️
src/engine/TextIndexScanForEntity.cpp 97.91% 0 Missing and 1 partial ⚠️
src/engine/TextIndexScanForWord.cpp 98.14% 0 Missing and 1 partial ⚠️
src/index/IndexImpl.Text.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1732      +/-   ##
==========================================
+ Coverage   90.18%   90.25%   +0.07%     
==========================================
  Files         400      402       +2     
  Lines       38440    38846     +406     
  Branches     4306     4367      +61     
==========================================
+ Hits        34666    35062     +396     
  Misses       2479     2479              
- Partials     1295     1305      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An initial round of reviews, please read the comments first, some are of a rather structural nature about the general design.

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle the code looks now very nice and clean, with only minor issues.
Of course we are still missing all sorts of unit tests.

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A review on everything but the tests.

If you need readable output in the tests when something fials,
you either need to overload std::ostream& operator<<(std::ostream&, const YourType&) or implement the PrintTo function for googletest and make it accessible to the tests.

configVarToConfigs_[subjectVar].isWordSearch_ = false;
if (object.isLiteral()) {
configVarToConfigs_[subjectVar].entity_ =
std::string(asStringViewUnsafe(object.getLiteral().getContent()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be a missing test case.

conf.varToBindScore_});
}
}
return output;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old ql:contains-word has special semantics for strings like "alpha beta blubb*"
wich actually splits into three words "alpha" , "beta" and the prefix "blubb*".
I still have to think what we shall do in this case (Maybe emit a warning, that becomes part of the created config (then you can propagate it in the query planner)

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, I have only very minor suggestions left, that I will quickly incorporate myself.

… the output of TextIndexScanForEntity and TextIndexScanForWord. Added more tests to increase code coverage.
@sparql-conformance
Copy link

Copy link

sonarqubecloud bot commented Mar 5, 2025

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