Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

OracleKeywordRetriever

Retrieve documents from an OracleDocumentStore using keyword-based search. Use this component in query pipelines that rely on lexical matching using Oracle Database 23ai's DBMS_SEARCH index.

Key Features​

  • Performs keyword search using Oracle's DBMS_SEARCH full-text index with CONTAINS queries.
  • Ranks results by relevance using Oracle's built-in SCORE() function.
  • Supports both thin (direct TCP) and thick (wallet/ADB-S) Oracle connection modes.
  • Configurable filter policy to merge or replace filters at query time.
  • Requires Oracle Database 23ai or later with DBMS_SEARCH enabled.

Configuration​

Add Workspace-Level Integration​

  1. Click your profile icon and choose Settings.
  2. Go to Workspace>Integrations.
  3. Find the provider you want to connect and click Connect next to them.
  4. Enter the API key and any other required details.
  5. Click Connect. You can use this integration in pipelines and indexes in the current workspace.

Add Organization-Level Integration​

  1. Click your profile icon and choose Settings.
  2. Go to Organization>Integrations.
  3. Find the provider you want to connect and click Connect next to them.
  4. Enter the API key and any other required details.
  5. Click Connect. You can use this integration in pipelines and indexes in all workspaces in the current organization.
  1. Set environment variables for your Oracle credentials: ORACLE_USER, ORACLE_PASSWORD, and ORACLE_DSN.
  2. Configure an OracleDocumentStore in your pipeline. The DBMS_SEARCH keyword index is created automatically when create_table_if_not_exists is True (the default). For pre-existing tables, call create_keyword_index() manually.
  3. Drag the OracleKeywordRetriever component onto the canvas from the Component Library.
  4. Connect the retriever output to downstream components such as PromptBuilder.

Connections​

OracleKeywordRetriever receives a query string as input. It outputs a list of Document objects ranked by keyword relevance that you can connect to PromptBuilder or other downstream components.

Source Code​

To check this component's source code, open keyword_retriever.py in the Haystack Core Integrations repository.

Usage Examples​

Basic Configuration​

OracleKeywordRetriever:
type: haystack_integrations.components.retrievers.oracle.keyword_retriever.OracleKeywordRetriever
init_parameters:
document_store: OracleDocumentStore
top_k: 5

Using the Component in a Pipeline​

# haystack-pipeline
components:
document_store:
type: haystack_integrations.document_stores.oracle.document_store.OracleDocumentStore
init_parameters:
connection_config:
user:
type: haystack.utils.Secret
init_parameters:
env_vars: ["ORACLE_USER"]
password:
type: haystack.utils.Secret
init_parameters:
env_vars: ["ORACLE_PASSWORD"]
dsn:
type: haystack.utils.Secret
init_parameters:
env_vars: ["ORACLE_DSN"]
embedding_dim: 1536

retriever:
type: haystack_integrations.components.retrievers.oracle.keyword_retriever.OracleKeywordRetriever
init_parameters:
document_store: document_store
top_k: 5

inputs:
query:
- retriever.query

outputs:
documents: retriever.documents

Parameters​

Inputs​

ParameterTypeDescription
querystrThe keyword query string to search for.
filtersOptional[Dict[str, Any]]Filters to apply when retrieving documents.
top_kOptional[int]The maximum number of documents to retrieve. Overrides the init-time value.

Outputs​

ParameterTypeDescription
documentsList[Document]A list of documents ranked by keyword relevance from the document store.

Init Parameters​

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
document_storeOracleDocumentStoreThe Oracle document store to retrieve documents from.
filtersOptional[Dict[str, Any]]NoneDefault filters to apply when retrieving documents.
top_kint10The maximum number of documents to retrieve.
filter_policyFilterPolicyFilterPolicy.REPLACEHow to handle filters passed at query time. REPLACE replaces init-time filters; MERGE combines them.

Run Method Parameters​

These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.

ParameterTypeDefaultDescription
querystrThe keyword query string.
filtersOptional[Dict[str, Any]]NoneRuntime filters to apply.
top_kOptional[int]NoneMaximum number of documents to retrieve. Overrides the init-time value.