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

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   doris 4.1.2
   
   ### What's Wrong?
   
    score function return different result when run same query twice.
   sql
        -- 1. 建表
        CREATE TABLE doris_test_db.test_score_nd (
            id INT NOT NULL,
            name VARCHAR(100),
            tag VARCHAR(50)
        ) DUPLICATE KEY(id)
        DISTRIBUTED BY HASH(id) BUCKETS 3
        PROPERTIES('replication_num'='1');   
   
     -- 2. 建倒排索引(关键步骤)
        CREATE INDEX idx_name ON doris_test_db.test_score_nd(name) USING 
INVERTED;    
   
    -- 3. 插数据
        INSERT INTO doris_test_db.test_score_nd VALUES
        (0,'李鹏','vip'),(1,'李鹏','normal'),(2,'李鹏','new'),(3,'李鹏','active'),
        (4,'李鹏','dormant'),(5,'李鹏','staff'),(6,'李鹏','manager'),(7,'李鹏','vip'),
        (8,'李鹏','normal'),(9,'李鹏','new'),(10,'李鹏','active'),(11,'李鹏','dormant'),
        
(12,'李鹏','staff'),(13,'李鹏','manager'),(14,'李鹏','vip'),(15,'李鹏','normal'),
        
(16,'李鹏','new'),(17,'李鹏','active'),(18,'李鹏','dormant'),(19,'李鹏','staff'),
        (20,'李鹏','manager'),(21,'李鹏','vip'),(22,'李鹏','normal'),(23,'李鹏','new'),
        
(24,'李鹏','active'),(25,'李鹏','dormant'),(26,'李鹏','staff'),(27,'李鹏','manager'),
        (28,'李鹏','vip'),(29,'李鹏','normal'),(30,'李鹏','new'),(31,'李鹏','active'),
        
(32,'李鹏','dormant'),(33,'李鹏','staff'),(34,'李鹏','manager'),(35,'李鹏','vip'),
        
(36,'李鹏','normal'),(37,'李鹏','new'),(38,'李鹏','active'),(39,'李鹏','dormant'),
        
(40,'李鹏','staff'),(41,'李鹏','manager'),(42,'李鹏','vip'),(43,'李鹏','normal'),
        
(44,'李鹏','new'),(45,'李鹏','active'),(46,'李鹏','dormant'),(47,'李鹏','staff'),
        (48,'李鹏','manager'),(49,'李鹏','vip');    
   
    -- 4. 验证索引已生效
        SHOW INDEX FROM doris_test_db.test_score_nd;   
   
     -- 5. 复现非确定性排序(多跑几次看结果是否不同)
        SELECT id, name, tag, score() AS relevance
        FROM doris_test_db.test_score_nd
        WHERE SEARCH('name:"李鹏"')
        ORDER BY relevance DESC
        LIMIT 10; 
   
   <img width="2022" height="1020" alt="Image" 
src="https://github.com/user-attachments/assets/c7a5da4b-d4bd-491d-9552-ccb8f32e8c96";
 />
   
   ### What You Expected?
   
   Should return the same result.
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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