airborne12 opened a new pull request, #66875:
URL: https://github.com/apache/doris/pull/66875
### What problem does this PR solve?
Issue Number: None
Related PR: #66052
Problem Summary:
SNII returned `INVERTED_INDEX_NOT_SUPPORTED` when a single-token
`MATCH_PHRASE_PREFIX` query requested `score()`, even though the same prefix
predicate succeeded without scoring.
A one-token phrase-prefix is a plain prefix rather than a phrase-frequency
query. V3 direct MATCH leaves this shape unscored, while the SEARCH query_v2
path uses a constant-score prefix fallback. This PR removes the SNII
scoring-only rejection and preserves those existing semantics instead of
introducing a new prefix BM25 model.
The real SNII segment test now verifies that the query succeeds, returns the
expected prefix matches, and exposes zero BM25 score in the direct MATCH path.
The V3 query_v2 test verifies its scored one-token fallback returns constant
score `1.0`.
### Release note
Allow scored single-token SNII `MATCH_PHRASE_PREFIX` queries.
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [x] Unit Test
-
`SniiIndexReaderCountFallback.PublicPhraseQueriesScoreOccurrenceFrequencyWithPlainTerms`
- `PhrasePrefixQueryV2Test.single_term_fallback_to_prefix`
- `SniiIndexReaderCountFallback.*:PhrasePrefixQueryV2Test.*` (42
tests)
- `./build.sh --be -j 192`
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [x] Yes. Scored single-token SNII phrase-prefix queries now execute
instead of returning an unsupported error.
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]