From 0c424df50ba8aebff38979ed395986ef999a1516 Mon Sep 17 00:00:00 2001 From: Michele Riva Date: Fri, 31 Jan 2025 15:14:34 +0100 Subject: [PATCH] docs: improves docs --- docs/content/docs/apis/create-collection.mdx | 8 ++++++-- docs/content/docs/apis/insert-documents.mdx | 6 +++++- docs/content/docs/apis/search-documents.mdx | 7 +++++-- docs/content/docs/javascript-hooks/introduction.mdx | 1 + docs/content/docs/text-embeddings.mdx | 8 ++++++-- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/docs/content/docs/apis/create-collection.mdx b/docs/content/docs/apis/create-collection.mdx index 1e496dd..e901deb 100644 --- a/docs/content/docs/apis/create-collection.mdx +++ b/docs/content/docs/apis/create-collection.mdx @@ -16,13 +16,17 @@ For example, if you want to index all the products in your e-commerce store, you ## APIs + +API Key type: **master**. + + Creating a new collection is as simple as: ```bash tab="cURL" curl -X POST \ http://localhost:8080/v0/collections \ - -H 'Authorization: Bearer ' \ + -H 'Authorization: Bearer ' \ -d '{ "id": "products", "write_api_key": "my-write-api-key", @@ -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 ' \ + -H 'Authorization: Bearer ' \ -d '{ "id": "products", "write_api_key": "my-write-api-key", diff --git a/docs/content/docs/apis/insert-documents.mdx b/docs/content/docs/apis/insert-documents.mdx index f20cd68..621d3fc 100644 --- a/docs/content/docs/apis/insert-documents.mdx +++ b/docs/content/docs/apis/insert-documents.mdx @@ -13,6 +13,10 @@ We will make these APIs stable in the v1.0.0 release, planned for February 28th, ## APIs + +API Key type: **`write_api_key`**. + + 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: @@ -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 ' \ + -H 'Authorization: Bearer ' \ -d '{ "title": "My first document", "content": "This is the content of my first document." diff --git a/docs/content/docs/apis/search-documents.mdx b/docs/content/docs/apis/search-documents.mdx index 073b702..16df452 100644 --- a/docs/content/docs/apis/search-documents.mdx +++ b/docs/content/docs/apis/search-documents.mdx @@ -12,14 +12,17 @@ We will make these APIs stable in the v1.0.0 release, planned for February 28th, ## APIs + +API Key type: **`read_api_key`**. + + To search for documents in a collection, you can use the following API: ```bash tab="cURL" curl -X POST \ - http://localhost:8080/v0/collections/{COLLECTION_ID}/search \ + http://localhost:8080/v0/collections/{COLLECTION_ID}/search?api_key= \ -H 'Content-Type: application/json' \ - -H 'Authorization: Bearer ' \ -d '{ "term": "The quick brown fox" }' ``` diff --git a/docs/content/docs/javascript-hooks/introduction.mdx b/docs/content/docs/javascript-hooks/introduction.mdx index 375df90..30b6e0d 100644 --- a/docs/content/docs/javascript-hooks/introduction.mdx +++ b/docs/content/docs/javascript-hooks/introduction.mdx @@ -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 ' \ -d '{ "id": "selectEmbeddingProperties", "code": "function selectEmbeddingProperties(document) { return document.title; }" diff --git a/docs/content/docs/text-embeddings.mdx b/docs/content/docs/text-embeddings.mdx index ef51d3f..5aef63d 100644 --- a/docs/content/docs/text-embeddings.mdx +++ b/docs/content/docs/text-embeddings.mdx @@ -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 ' \ -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"] } }' ```