Epsilla
HomeDiscordTwitterGithubEmail
  • Welcome
    • Register and Login
    • Explore App Portal
  • Build Your First AI Agent
    • Create a Knowledge Base
    • Set Up Your AI Agent
    • Publish Your AI Agent
  • Knowledge Base
    • Local Files
    • Website
    • Google Drive
    • S3
    • Notion
    • Share Point
    • Google Cloud Storage
    • Azure Blob Storage
    • Confluence
    • Jira
    • Advanced Settings
      • Auto Sync
      • Embedding
      • Data Parsing
      • Data Chunking
      • Hypothetical Questions
      • Webhook
      • Meta Data
    • Data Storage
    • Programmatically Manage Knowledge Bases
  • Application
    • Create New AI Agent
    • Basic Chat Agent Config
    • Basic Smart Search Agent Config
    • Advanced Workflow Customization
    • Publish and Deployment
    • User Engagement Analytics
  • Evaluation
    • Create New Evaluation
    • Run Evaluation
    • Evaluation Run History
  • Integration
  • Team Member Management
  • Project Management
  • Billing Management
  • Release Notes
  • Epsilla Vector Database
    • Overview
    • Quick Start
      • Run with Docker
      • Epsilla Cloud
    • User Manual
      • Connect to a database
      • Create a new table
      • Drop a table
      • Delete a database
      • Insert records
      • Upsert records
      • Search the top K semantically similar records
      • Retrieve records (with filters and pagination)
      • Delete records
      • Performance Tuning
    • Advanced Topics
      • Embeddings
      • Dense vector vs. sparse vector
      • Hybrid Search
    • Integrations
      • OpenAI
      • Mistral AI
      • Jina AI
      • Voyage AI
      • Mixedbread AI
      • Nomic AI
    • Roadmap
Powered by GitBook
On this page
  1. Epsilla Vector Database
  2. User Manual

Retrieve records (with filters and pagination)

Epsilla supports the retrieval of records from a table. By default, it retrieves all records from the table. Users can provide a primary key list to specify which records to retrieve; users can provide a filter condition to constrain the records obtained; users can provide 'limit' and 'skip' parameters to implement pagination on the records being retrieved.

Below is the complete example for all supported parameters:

status_code, response = db.get(
  table_name="MyTable",                  # The name of the table to query against.
  response_fields=["Doc"],               # (Optional) which fields to be included in
                                         # the response. If not provided, will include
                                         # all fields in the table.
  primary_keys=[1, 2, 4, 5],             # (Optional) the list of primary keys for retrieval.
                                         # If not provided, will not constrian on primary key
                                         # value.
  filter="Doc <> 'London'",              # (Optional) a boolean expression for filtering
                                         # out the results.
  skip=0,                                # (Optional) how many records to skip. If not
                                         # provided, will not skip any records.
  limit=2                                # (Optional) how many records to retrieve. If not
                                         # provided, will return all records (after the
                                         # skipped ones)
)
print(response)

Response example:

{'statusCode': 200, 'message': 'Query get successfully.', 'result': [{'Doc': 'Berlin'}, {'Doc': 'San Francisco'}]}
const query = await db.get(
  'MyTable',                                 // The name of the table to query against.
  {
    response: ["Doc"],                       // (Optional) which fields to be included in
                                             // the response. If not provided, will include
                                             // all fields in the table.
    primaryKeys: [1, 2, 4, 5],               // (Optional) the list of primary keys for retrieval.
                                             // If not provided, will not constrian on primary key
                                             // value.
    filter: 'ID < 6 AND Doc <> \'London\'',  // (Optional) filter: a boolean expression for filtering
                                             // out the results.
    skip: 0,                                 // (Optional) how many records to skip. If not
                                             // provided, will not skip any records.
    limit: 2                                 // (Optional) how many records to retrieve. If not
                                             // provided, will return all records (after the
                                             // skipped ones)
  }
);
console.log(JSON.stringify(query, undefined, 2));

Response example:

{
  "statusCode": 200,
  "message": "Query get successfully.",
  "result": [
    {
      "Doc": "Moscow"
    },
    {
      "Doc": "San Francisco"
    }
  ]
}

And below is the example with minimum parameters for retrieving records:

status_code, response = db.get(
  table_name="MyTable",
  limit=2
)
print(response)
const query = await db.get(
  'MyTable',
  {
      limit: 2
  }
);
console.log(JSON.stringify(query, undefined, 2));
PreviousSearch the top K semantically similar recordsNextDelete records

Last updated 1 year ago