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


##########
be/src/tools/index_tool.cpp:
##########
@@ -185,18 +185,19 @@ void search(lucene::store::Directory* dir, std::string& 
field, std::string& toke
         context->stats = &stats;
         context->io_ctx = &io_ctx;
 
-        ConjunctionQuery conjunct_query(s, context);
-        InvertedIndexQueryInfo query_info;
-        query_info.field_name = field_ws;
-        for (auto& term : terms) {
-            doris::segment_v2::TermInfo term_info;
-            term_info.term = term;
-            query_info.term_infos.push_back(term_info);
+        const doris::index_query::logical::Node leaf {
+                .value = doris::index_query::logical::TermSet {.field = {},
+                                                               .terms = 
split(token, '|'),
+                                                               .require_all = 
true,
+                                                               
.min_should_match = 0}};
+        auto result = std::make_shared<roaring::Roaring>();
+        const doris::Status status = run_clucene_leaf(context, field_ws, leaf, 
nullptr,
+                                                      /*scoring=*/false, s, 
result);
+        if (!status.ok()) {

Review Comment:
   [P2] Return a failing exit code when MATCH_ALL cannot read postings
   
   With `index_tool --operation=term_query --pred_type=match_all`, an index 
whose dictionary opens but whose posting payload fails to read now produces a 
non-OK `run_clucene_leaf` Status here. This branch only prints the error, then 
reports a zero/partial `Term queried count` and `main()` exits 0. Previously 
`ConjunctionQuery` let the read exception reach the existing `term_query` 
catch, which returned -1. Propagate this failure to the caller and skip 
reporting cardinality so diagnostics and automation cannot treat an incomplete 
query as success.



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