feat(query): allow unordered vector and full-text search results (#5328)

## Summary

Callers that consume every selected hit can relax the final output order
with `ordered_results(false)` in Rust, `ordered_results(False)` in
Python, or `orderedResults(false)` in TypeScript. Ranked output remains
the default. The option preserves top-k selection, each hit’s score and
projected columns, and the existing rules for ties at the cutoff.

Embedded passes eligible queries to the Lance scanner. Enterprise sends
`"ordered": false` for eligible searches and omits the field by default.
Explicit sorting, positive offsets, batch vector queries and inputs to
hybrid fusion or reranking keep their existing order.

## Validation

A managed Linux preview passed 8 Rust wire cases, 4 Embedded Python
cases, 10 HTTP mock cases and all 52 TypeScript query tests. The preview
used a candidate Lance revision. Project CI on this PR validates the
integration with the official Lance `v16.0.0-beta.6`.

Uses the official Lance dependency from #5327, now merged into `main`.
This commit is contained in:
Yang Cen
2026-12-01 20:41:37 +08:00
committed by GitHub
parent 0da2b7b307
commit 155457d0e5
17 changed files with 366 additions and 10 deletions
+24
View File
@@ -299,6 +299,30 @@ This query builder.
***
### orderedResults()
```ts
orderedResults(ordered): this
```
Require vector or full-text hits in rank order (the default).
Set false when you only need the selected rows and scores. The engine
may then return the hits in any order. Explicit sort keys take precedence.
#### Parameters
* **ordered**: `boolean`
#### Returns
`this`
#### Inherited from
`StandardQueryBase.orderedResults`
***
### outputSchema()
```ts
+24
View File
@@ -373,6 +373,30 @@ This query builder.
***
### orderedResults()
```ts
orderedResults(ordered): this
```
Require vector or full-text hits in rank order (the default).
Set false when you only need the selected rows and scores. The engine
may then return the hits in any order. Explicit sort keys take precedence.
#### Parameters
* **ordered**: `boolean`
#### Returns
`this`
#### Inherited from
`StandardQueryBase.orderedResults`
***
### outputSchema()
```ts
+24
View File
@@ -561,6 +561,30 @@ This query builder.
***
### orderedResults()
```ts
orderedResults(ordered): this
```
Require vector or full-text hits in rank order (the default).
Set false when you only need the selected rows and scores. The engine
may then return the hits in any order. Explicit sort keys take precedence.
#### Parameters
* **ordered**: `boolean`
#### Returns
`this`
#### Inherited from
`StandardQueryBase.orderedResults`
***
### outputSchema()
```ts