matrixorigin / matrixorigin/matrixone

[Feature Request]: Multi retrieval path using LIMIT BY RANK

Open
#22,920 1 comment 0 reactions 1 assignee Claimed by @ck89119 View on GitHub
deferred kind/feature
Dominant language
Go
Stars
1.9k
Forks
311
Avg merge
1d 3h
Merged PRs (30d)
768

Description

### Is there an existing issue for the same feature request?

- [x] I have checked the existing issues.

### Is your feature request related to a problem?

```Markdown
Customer may want to using multi retrieval path and then rerank. As of now, customer have to issue multiple queries then combine the result.

select a, b, c, l2_distance(x, '[1, 2, 3]') from T limit 20;
select a, b, c, match(y) against('foo bar zoo') from T limit 20;
```

### Describe the feature you'd like

Let customer issue just one query.

`select a, b, c, l2_distance(x, '[1, 2, 3]'), match(y) against('foo bar zoo') from T limit 20 BY RANK`

When customer issue a LIMIT BY RANK query, we will return top 20 rows by l2_distance UNION top 20 by match(y). Note that we may return less than 40 rows if some row appear in both vector index and fulltext result.

For returned values, if a row appear in both vector and fulltext index, distance and fulltext score should be set correctly. If the row only appear in one index, set the other value to NULL.

### Describe implementation you've considered

_No response_

### Documentation, Adoption, Use Case, Migration Strategy

```Markdown

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.