Skip to content

Commit

Permalink
fix wording in Quickstart and Filtering tutorials (#194)
Browse files Browse the repository at this point in the history
* update interactive tutorial for language and links

* fix two words

* fix filtering
  • Loading branch information
davidmyriel authored Aug 9, 2024
1 parent 53d395c commit accb8d8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
20 changes: 9 additions & 11 deletions src/components/InteractiveTutorial/MdxPages/FilteringClauses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ export const title = "Filtering Clauses"

# {title}

<Alert severity="info">Click **RUN** button at code blocks to see a result of the query in the right part of the screen.<br/>Click inside a code block to edit it.</Alert>
<br/>
<Alert severity="info">Click **RUN** to send the API request. Your response will be on the right. <br/>You may edit any code block and rerun the request.</Alert>

Qdrant support filtering of collections combining condition and clauses.
In this tutorial you will learn how to filter collections using **filtering clauses**.
Qdrant lets you to filter collections by combining **conditions** and **clauses**. In this tutorial, you will learn how to filter collections using filtering clauses.

Clauses are different logical operations, such as OR, AND, and NOT.
Clauses can be recursively nested into each other so that you can reproduce an arbitrary boolean expression.
You can nest them inside each other to create any boolean expression.

Let's start with creating a new collection and populating it with points.
Start by creating a new collection and adding vectors.

## Set up for this tutorial
## Setup

Before we start to practice with filtering conditions, let's create some datapoints to work with.

Expand All @@ -32,7 +30,7 @@ PUT collections/demo
}
```

2. And add points to it:
2. Add vectors:

``` json withRunButton="true"
PUT /collections/demo/points
Expand Down Expand Up @@ -68,7 +66,7 @@ PUT /collections/demo/points
```
</details>

Take a note of what data we put into points' `payload` field.
**Note:** Take a good look at each point's `payload` field. You will need to add a filter using this payload.

## Must

Expand Down Expand Up @@ -142,9 +140,9 @@ POST /collections/demo/points/scroll
}
```

## Clauses combination
## Combination

It is also possible to use several clauses simultaneously:
You can also use join different clauses:

``` json withRunButton="true"
POST /collections/demo/points/scroll
Expand Down
3 changes: 2 additions & 1 deletion src/components/InteractiveTutorial/MdxPages/Index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ You will use the [Qdrant REST API](https://api.qdrant.tech) to interact with sam
|[Quickstart](#/tutorial/quickstart)|Create a collection, upsert vectors & run a search.|
|[Payload Filtering](#/tutorial/filtering-clauses)|Refine search results based on payload conditions.|


## Next steps:

Once you are ready to leave this sandbox tutorial, you can try the complete [REST API](https://api.qdrant.tech) from the **Console**. All your resources will be persisted.

You can use one of our [language-specific Clients](https://qdrant.tech/documentation/interfaces/) to build your applications.
To begin building a prototype application, you should [setup Qdrant on Docker](https://qdrant.tech/documentation/quick-start/) and start using one of our [language-specific Clients](https://qdrant.tech/documentation/interfaces/).
17 changes: 9 additions & 8 deletions src/components/InteractiveTutorial/MdxPages/Quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ export const title = 'Quickstart';

# {title}

In this short example, you will create a Collection, load data into it and run a basic search query.
In this tutorial, you will create a collection, load data into it and run a basic search query.

<Alert severity="info">Click **RUN** button at code blocks to see a result of the query in the right part of the screen.<br/>Click inside a code block to edit it.</Alert>
<Alert severity="info">Click **RUN** to send the API request. Your response will be on the right. <br/>You may edit any code block and rerun the request.</Alert>

## Create a collection

You will be storing all of your vector data in a Qdrant collection. Let's call it `test_collection`. This collection will be using a dot product distance metric to compare vectors.
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.

```json withRunButton=true
PUT collections/test_collection
Expand All @@ -22,7 +22,7 @@ PUT collections/test_collection

## Add vectors

Let's now add a few vectors with a payload. Payloads are other data you want to associate with the vector:
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
Expand Down Expand Up @@ -64,7 +64,8 @@ PUT collections/test_collection/points

## Run a query

Let's ask a basic question - Which of our stored vectors are most similar to the query vector `[0.2, 0.1, 0.9, 0.7]`?
We need to ask a question in vector form:
</br>*Which of our stored vectors are most similar to the query vector ?* </br>`[0.2, 0.1, 0.9, 0.7]`

```json withRunButton=true
POST collections/test_collection/points/search
Expand All @@ -75,12 +76,12 @@ POST collections/test_collection/points/search
}
```

The results are returned in decreasing similarity order. Note that payload and vector data is missing in these results by default.
Qdrant will go through all available data and return results in order of decreasing similarity. Note that payload and vector data is missing in these results by default.
See [payload and vector in the result](https://qdrant.tech/documentation/concepts/search#payload-and-vector-in-the-result) on how to enable it.

## Add a filter

We can narrow down the results further by filtering by payload. Let's find the closest results that include "London".
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
Expand All @@ -99,7 +100,7 @@ POST collections/test_collection/points/search
}
```

You have just conducted vector search. You loaded vectors into a database and queried the database with a vector of your own. Qdrant found the closest results and presented you with a similarity score.
That’s it! You have just performed a vector search. You loaded vectors into a database and queried the database with your own vector. Qdrant found the closest results and presented you with a similarity score.

## Next steps

Expand Down

0 comments on commit accb8d8

Please sign in to comment.