Skip to content
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

docs: Use cosine similarity in quickstart example #219

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ Before we start to practice with filtering conditions, let's create some datapoi
1. Create a collection:

``` json withRunButton="true"
PUT collections/demo
PUT /collections/demo
{
"vectors": {
"size": 4,
"distance": "Dot"
"size": 4,
"distance": "Cosine"
}
}
```
Expand Down
14 changes: 7 additions & 7 deletions src/components/InteractiveTutorial/MdxPages/Quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ In this tutorial, you will create a collection, load data into it and run a basi

## Create a collection

First, create a collection to store vector data. Let’s name it `test_collection`. This collection will use the dot product distance metric to determine similarity between vectors. Added vectors will have 4 dimensions.
First, create a collection to store vector data. Let’s name it `test_collection`. This collection will use cosine similarity to determine the distance between vectors. Added vectors will have 4 dimensions.

```json withRunButton=true
PUT collections/test_collection
PUT /collections/test_collection
{
"vectors": {
"size": 4,
"distance": "Dot"
"distance": "Cosine"
}
}
```
Expand All @@ -25,7 +25,7 @@ PUT collections/test_collection
Now, you need to add a few vectors. For each vector, you will specify a JSON payload. A payload is metadata that describes each vector, such as `city`.

```json withRunButton=true
PUT collections/test_collection/points
PUT /collections/test_collection/points
{
"points": [
{
Expand Down Expand Up @@ -71,7 +71,7 @@ We need to ask a question in vector form:
`[0.2, 0.1, 0.9, 0.7]`

```json withRunButton=true
POST collections/test_collection/points/search
POST /collections/test_collection/points/search
{
"vector": [0.2, 0.1, 0.9, 0.7],
"limit": 3,
Expand All @@ -87,7 +87,7 @@ See [payload and vector in the result](https://qdrant.tech/documentation/concept
You can narrow down the results further by setting conditions on the payload. Let's filter the closest results that include the city of "London".

```json withRunButton=true
POST collections/test_collection/points/search
POST /collections/test_collection/points/search
{
"vector": [0.2, 0.1, 0.9, 0.7],
"filter": {
Expand All @@ -107,4 +107,4 @@ That’s it! You have just performed a vector search. You loaded vectors into a

## Next steps

In the next section, you will learn how to create complex filter conditions and how to use them in your queries.
In the next section, you will learn how to create complex filter conditions and how to use them in your queries.