github-actions[bot] commented on code in PR #69901:
URL: https://github.com/apache/doris/pull/69901#discussion_r4429977279


##########
be/src/storage/index/inverted/common/query_info.h:
##########
@@ -40,4 +40,11 @@ class TermInfo {
     }
 };
 
+// The name BM25 statistics of a MATCH are kept under. Two indexes of one 
column hold different
+// terms and lengths under the same field, so the field alone cannot key them: 
over Apple and
+// apple, an index that folds case has df(apple) = 2 and one that does not has 
df(apple) = 1.
+inline std::wstring match_statistics_field(const std::wstring& field, int64_t 
index_id) {
+    return field + L"@" + std::to_wstring(index_id);

Review Comment:
   [P2] Keep MATCH keys disjoint from raw SEARCH fields
   
   A synthetic MATCH key can also be a valid SEARCH field for a VARIANT 
subcolumn. For a scoring-capable parent index with ID 2001 and parent column 
UID 1, MATCH on `v['a']` collects under `1.v.a@2001`, exactly the raw key used 
by `search('alpha', '{"default_field":"v.a@2001"}')`. Both collectors write to 
the same map, but their inherited index suffixes differ (`v%2Ea` versus 
`v%2Ea@2001`), so `validate_same_physical_index()` rejects whichever predicate 
is collected second. This makes a previously valid mixed MATCH/SEARCH query 
fail when it requests `score()`. Use a tagged or structured identity that 
cannot collide with raw SEARCH fields, and cover a VARIANT key ending in 
`@<actual-index-id>`.



-- 
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]

Reply via email to