mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-17 16:14:00 +00:00
A broad documentation pass across the areas LanceDB Enterprise and Embedded diverge on most: **Data Curation** -- GPU Function execution, Slurm scheduling (and what Slurm is, for readers new to it), blob late materialization as its own page, joins, aggregation/profiling, sampling, near-duplicate detection, chunking, distributed shuffle, and IVF-partition clustering. **Feature Engineering** -- computed columns and materialized views, restructured to lead with the Function-based path and show the SQL form side by side with Python throughout; a single Auto Refresh page instead of duplicating scheduling details on every refresh page; adaptive execution; checkpointing; GPU and Slurm placement for refresh workers; a Training Cache page for the PyTorch data loader's automatic cache benefit. **Security & Governance** -- an Audit Log reference (schema, access, grants), Secrets promoted to an ordinary catalog object with their own SQL DDL and a vending/rotation guide, and privilege-table fixes verified against the authorization source. **Deployment & Maintenance** -- Horizontal Scaling and OpenTelemetry moved into a real Deployment area; Automated Cleanup folded into Intelligent Auto-Maintenance (every other maintenance decision already lived there); RTE Compaction and Advanced Conflict Resolution documented in depth. **Landing page** -- the Enterprise feature comparison table reorganized (several redundant or stale rows removed, several new areas added), and the "why Enterprise" bullets replaced with ones tied to a concrete page (Performance, Scale, Fault tolerance, Multicloud deployment, Simplify operations) instead of vague promises. Plus a full pass addressing lancedb-gatekeeper's review: a real test-safety bug (a quickstart test could silently overwrite and delete a deployment's own `frames` table), a fabricated SQL statement with no backing implementation, an actual dedup-guarantee bug in `take_row_ids`, and dozens of documentation-accuracy fixes verified against source rather than taken on faith -- each either fixed, or left with an explicit note on why it needs a feature or deployment owner's sign-off instead of being guessed at. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018PXMCbRH6i5w47TsjeEUMT --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
68 lines
3.6 KiB
Plaintext
68 lines
3.6 KiB
Plaintext
---
|
|
title: Watsonx Reranker
|
|
sidebarTitle: "IBM watsonx.ai"
|
|
description: Rerank LanceDB search results with the IBM watsonx.ai text rerank API. Supports vector, FTS, and hybrid search with configurable models, projects, and spaces.
|
|
|
|
---
|
|
|
|
import { PyRerankingWatsonxUsage } from '/snippets/provider_examples.mdx';
|
|
|
|
# Watsonx Reranker
|
|
|
|
This reranker uses the [IBM watsonx.ai](https://cloud.ibm.com/docs/apis/watsonx-ai#text-rerank) text rerank API to reorder search results. Pass `WatsonxReranker()` to the `rerank()` method on a query. Credentials come from the `WATSONX_API_KEY` and `WATSONX_PROJECT_ID` (or `WATSONX_SPACE_ID`) environment variables, or can be passed explicitly as arguments.
|
|
|
|
> **Note:** Supported query types: Hybrid, Vector, and FTS.
|
|
|
|
<CodeGroup>
|
|
```bash Bash icon="terminal"
|
|
pip install ibm-watsonx-ai
|
|
```
|
|
</CodeGroup>
|
|
|
|
Replace the credential placeholders with your provider credentials. In application code, load credentials from environment variables or a secrets manager.
|
|
|
|
<CodeGroup>
|
|
<CodeBlock filename="Python" language="Python" icon="python">
|
|
{PyRerankingWatsonxUsage}
|
|
</CodeBlock>
|
|
</CodeGroup>
|
|
|
|
## Accepted Arguments {#accepted-arguments}
|
|
| Argument | Type | Default | Description |
|
|
| --- | --- | --- | --- |
|
|
| `model_name` | `str` | `"cross-encoder/ms-marco-minilm-l-12-v2"` | The rerank model ID. See [supported rerank models](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models-embed.html?context=wx#rerank). |
|
|
| `column` | `str` | `"text"` | The name of the table column to use as document input. |
|
|
| `top_n` | `int` | `None` | The number of results to return. If `None`, all results are returned. |
|
|
| `return_score` | `str` | `"relevance"` | Options are `"relevance"` or `"all"`. Controls which score columns are kept on the result. |
|
|
| `api_key` | `str` | `None` | IBM Cloud API key. Falls back to the `WATSONX_API_KEY` environment variable. |
|
|
| `project_id` | `str` | `None` | watsonx.ai project ID. Falls back to `WATSONX_PROJECT_ID`. Mutually exclusive with `space_id`. |
|
|
| `space_id` | `str` | `None` | watsonx.ai deployment space ID. Falls back to `WATSONX_SPACE_ID`. Mutually exclusive with `project_id`. |
|
|
| `url` | `str` | `"https://us-south.ml.cloud.ibm.com"` | watsonx.ai service URL. |
|
|
| `truncate_input_tokens` | `int` | `None` | Truncate each document to this many tokens before scoring. |
|
|
|
|
<Info>
|
|
You must supply exactly one of `project_id` or `space_id` (either as an argument or via its environment variable). Setting both, or neither, raises a `ValueError`.
|
|
</Info>
|
|
|
|
## Supported scores for each query type {#supported-scores-for-each-query-type}
|
|
|
|
You can specify the type of scores you want the reranker to return. The following are the supported scores for each query type:
|
|
|
|
### Hybrid Search {#hybrid-search}
|
|
|`return_score`| Status | Description |
|
|
| --- | --- | --- |
|
|
| `relevance` | ✅ Supported | Results only have the `_relevance_score` column. |
|
|
| `all` | ❌ Not Supported | Results have vector(`_distance`) and FTS(`score`) along with Hybrid Search score(`_relevance_score`). |
|
|
|
|
### Vector Search {#vector-search}
|
|
|`return_score`| Status | Description |
|
|
| --- | --- | --- |
|
|
| `relevance` | ✅ Supported | Results only have the `_relevance_score` column. |
|
|
| `all` | ✅ Supported | Results have vector(`_distance`) along with Hybrid Search score(`_relevance_score`). |
|
|
|
|
### FTS Search {#fts-search}
|
|
|`return_score`| Status | Description |
|
|
| --- | --- | --- |
|
|
| `relevance` | ✅ Supported | Results only have the `_relevance_score` column. |
|
|
| `all` | ✅ Supported | Results have FTS(`score`) along with Hybrid Search score(`_relevance_score`). |
|