Skip to content

Commit

Permalink
docs: improves docs
Browse files Browse the repository at this point in the history
  • Loading branch information
micheleriva committed Jan 31, 2025
1 parent f2fa514 commit 0c424df
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
8 changes: 6 additions & 2 deletions docs/content/docs/apis/create-collection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ For example, if you want to index all the products in your e-commerce store, you

## APIs

<Callout>
API Key type: **master**.
</Callout>

Creating a new collection is as simple as:

<Tabs groupId='create' persist items={['cURL']}>
```bash tab="cURL"
curl -X POST \
http://localhost:8080/v0/collections \
-H 'Authorization: Bearer <api-key>' \
-H 'Authorization: Bearer <master-api-key>' \
-d '{
"id": "products",
"write_api_key": "my-write-api-key",
Expand All @@ -38,7 +42,7 @@ A more complete example, with all the optional fields:
curl -X POST \
http://localhost:8080/v0/collections \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-H 'Authorization: Bearer <master-api-key>' \
-d '{
"id": "products",
"write_api_key": "my-write-api-key",
Expand Down
6 changes: 5 additions & 1 deletion docs/content/docs/apis/insert-documents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ We will make these APIs stable in the v1.0.0 release, planned for February 28th,

## APIs

<Callout>
API Key type: **`write_api_key`**.
</Callout>

To insert a new document, you first need to create a new [collection](/docs/apis/create-collection).

Once you have a collection, you can start inserting documents using the following API:
Expand All @@ -22,7 +26,7 @@ Once you have a collection, you can start inserting documents using the followin
curl -X PATCH \
http://localhost:8080/v0/collections/{COLLECTION_ID}/documents \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-H 'Authorization: Bearer <write_api_key>' \
-d '{
"title": "My first document",
"content": "This is the content of my first document."
Expand Down
7 changes: 5 additions & 2 deletions docs/content/docs/apis/search-documents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ We will make these APIs stable in the v1.0.0 release, planned for February 28th,

## APIs

<Callout>
API Key type: **`read_api_key`**.
</Callout>

To search for documents in a collection, you can use the following API:

<Tabs groupId='search' persist items={['cURL']}>
```bash tab="cURL"
curl -X POST \
http://localhost:8080/v0/collections/{COLLECTION_ID}/search \
http://localhost:8080/v0/collections/{COLLECTION_ID}/search?api_key=<read_api_key> \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{ "term": "The quick brown fox" }'
```
</Tabs>
Expand Down
1 change: 1 addition & 0 deletions docs/content/docs/javascript-hooks/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Here's an example of how to create a JavaScript hook:

curl -X POST http://localhost:8080/{COLLECTION_ID}/v0/hooks/add \
-H 'Content-Type: application/json' \
-H 'Authorization Bearer <write-api-key>' \
-d '{
"id": "selectEmbeddingProperties",
"code": "function selectEmbeddingProperties(document) { return document.title; }"
Expand Down
8 changes: 6 additions & 2 deletions docs/content/docs/text-embeddings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,17 @@ Since OramaCore is schemaless, concatenating all string fields is a simple and e
To customize text extraction, you can specify the fields to use and the model to generate embeddings when creating a collection:

```bash title="Creating a collection"
curl -X POST http://localhost:8080/v0/collections \
curl -X POST \
http://localhost:8080/v0/collections \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <master-api-key>' \
-d '{
"id": "products",
"write_api_key": "my-write-api-key",
"read_api_key": "my-read-api-key",
"embeddings": {
"model": "BGESmall",
"typed_fields": ["productName", "description", "brand"]
"document_fields": ["productName", "description", "brand"]
}
}'
```
Expand Down

0 comments on commit 0c424df

Please sign in to comment.