ajayaks opened a new issue, #64178:
URL: https://github.com/apache/doris/issues/64178

   Hi, 
   
   I was trying to run the hybrid search via below route
   
   - Create a view with structured filter
   - Then text search + semantic search 
   - RRF
   I m using 4.1.0 version
   
   High level:- 
   The query works correctly when selecting columns from the View directly. 
However, when score() is added to the query, Doris returns the ranking score 
but does not return values for the projected columns such as hotel_id and 
hotel_name.
   
   Details:- 
   
   //View
   CREATE or REPLACE VIEW hotel_candidates AS
   SELECT
       hotel_id, 
city,check_in_window,hotel_name,nightly_price,hotel_description,hotel_tags,
       description_embedding
   FROM hotels
   WHERE
       city = 'Seattle'
       AND check_in_window = 'Next weekend'
       AND nightly_price BETWEEN 150 AND 500;
                        
   select hotel_id,
       hotel_name, city, hotel_description  from hotel_candidates; [Working 
fine]
   ``<html xmlns:o="urn:schemas-microsoft-com:office:office"
   xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
   xmlns="http://www.w3.org/TR/REC-html40";>
   
   <head>
   
   <meta name=ProgId content=OneNote.File>
   <meta name=Generator content="Microsoft OneNote 15">
   </head>
   
   <body lang=en-US style='font-family:Calibri;font-size:11.0pt'>
   <!--StartFragment-->
   
   <div style='direction:ltr'>
   
   
   hotel_id | hotel_name | city | hotel_description
   -- | -- | -- | --
   H003 | Pike Place Palace | Seattle | Historic luxury   hotel overlooking 
Pike Place Market with premium spa services
   H008 | Azure Heights | Seattle | Premium luxury hotel   with rooftop 
amenities and personalized concierge services
   H001 | The Grand Seattle | Seattle | A luxurious boutique   hotel with 
stunning ocean views and world-class amenities
   H012 | Capitol Hill   Quarters | Seattle | Hip and cozy hotel   in the heart 
of Capitol Hill with local coffee culture vibes
   
   
   
   </div>
   
   <!--EndFragment-->
   </body>
   
   </html>
   
   
   // Below is the ISSUE as no hotel_id and hotel_name in output with score() 
function. 
                
   SELECT
   hotel_id, hotel_name,score() AS text_score
       FROM hotel_candidates
   WHERE hotel_description MATCH_ANY 'luxury boutique'
   ORDER BY text_score DESC
   LIMIT 1<img width="1123" height="240" alt="Image" 
src="https://github.com/user-attachments/assets/8341672a-9d3e-46f8-a2d9-e1f2f057a661";
 />->
   
   Its only showing the text_score not the other columns data while using the 
score().
   hotel_candidates view to represent the structured filtering stage of Hybrid 
Search. However, Doris appears to have a limitation (or optimizer issue) when 
using the full-text ranking function score() on top of a view. While MATCH_ANY 
works correctly through the view, score() does not properly return the 
associated row columns (hotel_id, hotel_name), so for the text-search stage we 
queried the base table directly while keeping the same structured filters.
   
   Note:- The same query works fine when run directly on the table instead of 
the view. 


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