airborne12 opened a new pull request, #60798:
URL: https://github.com/apache/doris/pull/60798

   ### What problem does this PR solve?
   
   Issue Number: close #DORIS-24542
   
   Problem Summary:
   When a column has multiple inverted indexes with different analyzers (e.g., 
one default untokenized index and one with English parser), `search()` in 
Lucene/scalar mode returns empty results.
   
   **Root cause:** In `FieldReaderResolver::resolve()`, `select_best_reader()` 
was always called with an empty analyzer key `""`, causing it to pick the wrong 
(untokenized) index for tokenized queries. Additionally, the EQUAL_QUERY → 
MATCH_ANY_QUERY upgrade was restricted to variant subcolumns only.
   
   **Fix:**
   1. Extract `analyzer_key` from FE-provided `index_properties` before calling 
`select_best_reader()` and pass it through
   2. Remove the `is_variant_sub` restriction on the query type upgrade so 
regular columns with multiple indexes also get the correct FULLTEXT reader
   
   ### Release note
   
   Fix search() returning empty results when a column has multiple inverted 
indexes with different analyzers.
   
   ### Check List (For Author)
   
   - Test
       - [x] Regression test
       - [ ] Unit Test
       - [ ] 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
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. search() now correctly uses the analyzer-based index when 
multiple inverted indexes exist on the same column.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label


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