mirror of
https://github.com/lancedb/lancedb.git
synced 2026-12-03 07:45:17 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user