Skip to content

[Bug] Report error when use Relevance Score function and search function for FULLTEXT Search #59888

@imtiaotiao

Description

@imtiaotiao

Search before asking

  • I had searched in the issues and found no similar issues.

Version

4.0.2

What's Wrong?

I want to use the full-text index feature and sort the results by relevance score. According to the official documentation, you must include at least a MATCH or SEARCH function in the WHERE clause to use the relevance scoring functions. So I execute this SQL:

SELECT `key` as pri, '%s' tbn, SCORE() as sc 
FROM `project_test`.`entity_test_entity` 
WHERE search("name:张三")
ORDER BY sc DESC
LIMIT 100

But the doris report an error:

Execution failed: Error Failed to execute sql: java.sql.SQLException: (conn=407) errCode = 2, detailMessage = WHERE clause must contain at least one MATCH function for score() push down optimization

What You Expected?

If possible, please take some time to investigate and fix the bug in this feature. Thank you!

How to Reproduce?

As the above example, it will be reproduced.

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions