iQ Suite - Docs
SDK ReferenceDocument RAG

Search

Perform a search query on a specific index.

Description

The /index/search endpoint allows you to perform a search query on a specific index to retrieve relevant documents based on the search criteria.

HTTP Request

POST /index/search

Authentication

All requests must include an Authorization header with a valid API key.

Headers

KeyValue
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/json

Request Body

  • index: The ID of the index to search.
  • query: The search query string.

JSON

FieldTypeDescription
indexstringThe ID of the index to search
querystringThe search query string

Request Example

try:
    results = client.search(
        index_id='your_index_id',
        query="neural networks"
    )
    print(results)
        
except APIError as e:
    print(f"Error: {e}")

Response

Success

Status Code: 200 OK

Body:

{
   "data": {
       "results": [
           {
               "id": "d7d67167-dde5-4a9a-85f7-e4fc33adaf67",
               "matched": "text chunk ..."
           }
       ],
       "sources": [
           {
               "document": "1d4b3cb2-764d-42c0-b242-71a0edbf47c7",
               "pages": [
                   {
                       "page_number": "1",
                       "source": "text chunk ...",
                       "source_type": "text_or_paragraph"
                   }
               ]
           }
       ]
   }
}

On this page