> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseplate.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Document Filtered Search

> Performs a full text search on documents in a dataset, then uses those documents to perform an embedding search on the dataset. This is the same as calling /search-documents followed by /search, and using the documents from the first call as a metadata filter.

### Path Parameters

<ParamField path="id" type="string" required>
  Dataset ID
</ParamField>

### Header

<ParamField path="Authorization" type="string">
  Baseplate API key. Must be in the format "Bearer \$BASEPLATE\_API\_KEY"
</ParamField>

### Body Parameters

<ParamField body="query" type="string" required>
  Query string
</ParamField>

<ParamField body="top_k_documents" type="number" default="3">
  Number of documents to use in embedding search filter.
</ParamField>

<ParamField body="top_k_rows" type="number" default="3">
  Number of documents to use in embedding search filter.
</ParamField>

### Responses

<Tab title="🟢 200: OK">
  ```json theme={null}
  {
    "document_results": [
      {
        "document_id": "fc74e81e-05ac-4df6-936f-ce51cc69a868",
        "dataset_id": "e2fa7f7b-d580-4ecf-8232-a1131938a3fc",
        "content": "",
        "filename": "doc1.pdf",
        "url": "/5274962e-04c3-4a23-b3d5-1d7e1ea6a230/doc1.pdf",
        "similarity": 0.0919062
      },
      {
        "document_id": "e6afaf5b-e8f0-4af3-ba50-bbb2d0d1f1af",
        "dataset_id": "e2fa7f7b-d580-4ecf-8232-a1131938a3fc",
        "content": "",
        "filename": "doc2.pdf",
        "url": "/5274962e-04c3-4a23-b3d5-1d7e1ea6a230/doc2.pdf",
        "similarity": 0.0919062
      }
    ],
    "results": [
      {
        "embedding": "Example text",
        "data": {
          "text": "Example text"
        },
        "confidence": 10.3084955,
        "query": "text",
        "metadata": {
          "documentId": "fc74e81e-05ac-4df6-936f-ce51cc69a868",
          "rowId": 567228,
          "url": "/5274962e-04c3-4a23-b3d5-1d7e1ea6a230/doc1.pdf"
        }
      },
      {
        "embedding": "Example text 2",
        "data": {
          "text": "Example text 2"
        },
        "confidence": 10.3084955,
        "query": "text",
        "metadata": {
          "documentId": "e6afaf5b-e8f0-4af3-ba50-bbb2d0d1f1af",
          "rowId": 569813,
          "url": "/5274962e-04c3-4a23-b3d5-1d7e1ea6a230/doc2.pdf"
        }
      }
    ]
  }
  ```
</Tab>
