Skip to main content
POST
/
api
/
v1
/
collections
/
search
curl -X POST "https://api.mielto.com/api/v1/collections/search" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "How to configure API authentication",
    "collection_id": "col_123456789",
    "search_type": "hybrid",
    "max_results": 10
  }'
{
  "results": [
    {
      "content": "API authentication can be configured using either API keys or Bearer tokens. To use API keys, include the X-API-Key header in your requests...",
      "score": 0.95,
      "metadata": {
        "document_title": "Authentication Guide",
        "section": "API Keys",
        "page": 1
      },
      "content_id": "content_123456",
      "source": "authentication-guide.pdf"
    },
    {
      "content": "When configuring authentication, ensure you store your API keys securely and never expose them in client-side code...",
      "score": 0.87,
      "metadata": {
        "document_title": "Security Best Practices",
        "section": "API Security",
        "page": 3
      },
      "content_id": "content_789012",
      "source": "security-guide.pdf"
    }
  ],
  "total_results": 2,
  "query": "How to configure API authentication",
  "search_type": "hybrid",
  "collection_id": "col_123456789",
  "execution_time_ms": 45.2
}

Search Collection

Search within a collection using knowledge search with support for different search types including fulltext, semantic, and hybrid search.

Headers

Authorization
string
Bearer token for authentication
X-API-Key
string
API key for authentication (alternative to Authorization header)
X-Workspace-Id
string
Optional. Derived from API Key, but can be specified if you have access to multiple workspaces

Request Body

query
string
required
Search query string
collection_id
string
required
ID of the collection to search in
search_type
string
default:"hybrid"
Type of search to perform (vector, keyword, hybrid)
max_results
integer
default:"10"
Maximum number of results to return (1-100)
filters
object
Additional filters to apply to the search

Response

results
array
Array of search results
total_results
integer
Total number of results found
query
string
Original search query
search_type
string
Type of search performed
collection_id
string
Collection that was searched
execution_time_ms
number
Search execution time in milliseconds
curl -X POST "https://api.mielto.com/api/v1/collections/search" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "How to configure API authentication",
    "collection_id": "col_123456789",
    "search_type": "hybrid",
    "max_results": 10
  }'
{
  "results": [
    {
      "content": "API authentication can be configured using either API keys or Bearer tokens. To use API keys, include the X-API-Key header in your requests...",
      "score": 0.95,
      "metadata": {
        "document_title": "Authentication Guide",
        "section": "API Keys",
        "page": 1
      },
      "content_id": "content_123456",
      "source": "authentication-guide.pdf"
    },
    {
      "content": "When configuring authentication, ensure you store your API keys securely and never expose them in client-side code...",
      "score": 0.87,
      "metadata": {
        "document_title": "Security Best Practices",
        "section": "API Security",
        "page": 3
      },
      "content_id": "content_789012",
      "source": "security-guide.pdf"
    }
  ],
  "total_results": 2,
  "query": "How to configure API authentication",
  "search_type": "hybrid",
  "collection_id": "col_123456789",
  "execution_time_ms": 45.2
}
Search types:
  • vector: Semantic similarity search using embeddings
  • keyword: Traditional keyword-based search
  • hybrid: Combination of vector and keyword search (recommended)