Skip to content

v1.14: Get documents by ids #3208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions reference/api/documents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Use `offset` and `limit` to browse through documents.
| **`fields`** | Array of strings/`null` | `*` | Document attributes to show (case-sensitive, comma-separated) |
| **`filter`** | String/Array of array of strings/`null` | N/A | Refine results based on attributes in the `filterableAttributes` list |
| **`retrieveVectors`** | Boolean | `false` | Return document vector data with search result |
| **`ids`** | Array of primary keys | `null` | Return documents based on their primary keys |

<Capsule intent="note">
Sending an empty payload (`--data-binary '{}'`) will return all documents in the index.
Expand All @@ -50,6 +51,10 @@ Sending an empty payload (`--data-binary '{}'`) will return all documents in the
| **`limit`** | Integer | Number of documents returned |
| **`total`** | Integer | Total number of documents in the index |

<Capsule intent="note" title="Returned document order">
`/indexes/{index_uid}/documents/fetch` and `/indexes/{index_uid}/documents` responses do not return documents following the order of their primary keys.
</Capsule>

### Example

<CodeSamples id="get_documents_post_1" />
Expand Down Expand Up @@ -118,6 +123,7 @@ Using the query parameters `offset` and `limit`, you can browse through all your
| **`fields`** | `*` | Document attributes to show (case-sensitive, comma-separated) |
| **`filter`** | N/A | Refine results based on attributes in the `filterableAttributes` list |
| **`retrieveVectors`** | `false` | Return document vector data with search result |
| **`ids`** | `null` | Return documents based on their primary keys |

### Response

Expand All @@ -128,6 +134,10 @@ Using the query parameters `offset` and `limit`, you can browse through all your
| **`limit`** | Integer | Number of documents returned |
| **`total`** | Integer | Total number of documents in the index |

<Capsule intent="note" title="Returned document order">
`/indexes/{index_uid}/documents/fetch` and `/indexes/{index_uid}/documents` responses do not return documents following the order of their primary keys.
</Capsule>

### Example

<CodeSamples id="get_documents_1" />
Expand Down