Skip to content

Commit

Permalink
Release new docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Milvus-doc-bot authored and Milvus-doc-bot committed Sep 12, 2023
1 parent 97b3d84 commit 78a3e51
Show file tree
Hide file tree
Showing 28 changed files with 669 additions and 1,098 deletions.
2 changes: 1 addition & 1 deletion v2.2.x/site/en/getstarted/install_SDKs/install-csharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Run the following command to install Milvus C# SDK.
Having installed Milvus Java SDK, you can:

- Learn the basic operations of Milvus:
- [Manage Database](manage_database.md)
- [Manage Database](manage_databases.md)
- [Connect to Milvus server](manage_connection.md)
- [Create a collection](create_collection.md)
- [Create a partition](create_partition.md)
Expand Down
8 changes: 8 additions & 0 deletions v2.2.x/site/en/menuStructure/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@
"label3": "",
"order": 3
},
{
"id": "install-csharp.md",
"title": "C# SDK",
"label1": "getstarted",
"label2": "install_sdks",
"label3": "",
"order": 3
},
{
"id": "milvus_lite.md",
"title": "With Milvus Lite",
Expand Down
121 changes: 22 additions & 99 deletions v2.2.x/site/en/userGuide/build_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ Prepare the index parameters as follows:
<div class="multipleCode">
<a href="#python">Python </a>
<a href="#java">Java</a>
<a href="#go">GO</a>
<a href="#go">Go</a>
<a href="#javascript">Node.js</a>
<a href="#csharp">C#</a>
</div>

```python
Expand Down Expand Up @@ -61,42 +62,12 @@ final IndexType INDEX_TYPE = IndexType.IVF_FLAT; // IndexType
final String INDEX_PARAM = "{\"nlist\":1024}"; // ExtraParam
```

<div style="display: none">

```shell
create index

Collection name (book): book

The name of the field to create an index for (book_intro): book_intro

Index type (FLAT, IVF_FLAT, IVF_SQ8, IVF_PQ, RNSG, HNSW, ANNOY): IVF_FLAT

Index metric type (L2, IP, HAMMING, TANIMOTO): L2

Index params nlist: 1024

Timeout []:
```csharp
var indexType = IndexType.IvfFlat;
var metricType = SimilarityMetricType.L2;
var extraParams = new Dictionary<string, string> { ["nlist"] = "1024" };
```

```curl
curl -X 'POST' \
'http://localhost:9091/api/v1/index' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"collection_name": "book",
"field_name": "book_intro",
"extra_params":[
{"key": "metric_type", "value": "L2"},
{"key": "index_type", "value": "IVF_FLAT"},
{"key": "params", "value": "{\"nlist\":1024}"}
]
}'
```

</div>

<table class="language-python">
<thead>
<tr>
Expand Down Expand Up @@ -307,22 +278,7 @@ curl -X 'POST' \
</tbody>
</table>

<table class="language-shell" style="display: none">
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>--help</td>
<td>Displays help for using the command.</td>
</tr>
</tbody>
</table>

<table class="language-curl" style="display: none">
<table class="language-csharp">
<thead>
<tr>
<th>Parameter</th>
Expand All @@ -331,57 +287,31 @@ curl -X 'POST' \
</tr>
</thead>
<tbody>
<tr>
<td><code>collection_name</code></td>
<td>Name of the collection to build the index on.</td>
</tr>
<tr>
<td><code>field_name</code></td>
<td>Name of the vector field to build the index on.</td>
</tr>
<tr>
<td><code>metric_type</code></td>
<td>Type of metrics used to measure the similarity of vectors.</td>
<td>For floating point vectors:
<ul>
<li><code>L2</code> (Euclidean distance)</li>
<li><code>IP</code> (Inner product)</li>
</ul>
For binary vectors:
<ul>
<li><code>JACCARD</code> (Jaccard distance)</li>
<li><code>TANIMOTO</code> (Tanimoto distance)</li>
<li><code>HAMMING</code> (Hamming distance)</li>
<li><code>SUPERSTRUCTURE</code> (Superstructure)</li>
<li><code>SUBSTRUCTURE</code> (Substructure)</li>
</ul>
</td>
</tr>
<tr>
<td><code>index_type</code></td>
<td><code>indexType</code></td>
<td>Type of index used to accelerate the vector search.</td>
<td>For floating point vectors:
<ul>
<li><code>FLAT</code> (FLAT)</li>
<li><code>IVF_FLAT</code> (IVF_FLAT)</li>
<li><code>IVF_SQ8</code> (IVF_SQ8)</li>
<li><code>IVF_PQ</code> (IVF_PQ)</li>
<li><code>HNSW</code> (HNSW)</li>
<li><code>ANNOY</code> (ANNOY)</li>
<li><code>IndexType.Flat</code> (FLAT)</li>
<li><code>IndexType.IvfFlat</code> (IVF_FLAT)</li>
<li><code>IndexType.IvfSq8</code> (IVF_SQ8)</li>
<li><code>IndexType.IvfPq</code> (IVF_PQ)</li>
<li><code>IndexType.Hnsw</code> (HNSW)</li>
<li><code>IndexType.Annoy</code> (ANNOY)</li>
</ul>
For binary vectors:
<ul>
<li><code>BIN_FLAT</code> (BIN_FLAT)</li>
<li><code>BIN_IVF_FLAT</code> (BIN_IVF_FLAT)</li>
<li><code>IndexType.BinFlat</code> (BIN_FLAT)</li>
<li><code>IndexType.BinIvfFlat</code> (BIN_IVF_FLAT)</li>
</ul>
</td>
</tr>
<tr>
<td><code>params</code></td>
<td><code>ExtraParam</code></td>
<td>Building parameter(s) specific to the index.</td>
<td>See <a href="index.md">In-memory Index</a> for more information.</td>
</tr>
</tbody>
</tbody>
</table>

## Build index
Expand All @@ -391,8 +321,9 @@ Build the index by specifying the vector field name and index parameters.
<div class="multipleCode">
<a href="#python">Python </a>
<a href="#java">Java</a>
<a href="#go">GO</a>
<a href="#go">Go</a>
<a href="#javascript">Node.js</a>
<a href="#csharp">C#</a>
</div>

```python
Expand Down Expand Up @@ -442,18 +373,10 @@ milvusClient.createIndex(
);
```

<div style="display: none">

```shell
# Follow the previous step.
```csharp
await milvusClient.GetCollection("book").CreateIndexAsync("book_intro", indexType, metricType, extraParams: extraParams);
```

```curl
# Follow the previous step.
```

</div>

<table class="language-python">
<thead>
<tr>
Expand Down
20 changes: 20 additions & 0 deletions v2.2.x/site/en/userGuide/build_scalar_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ To build an index on scalar fields, you do not need to set any index parameters.

The following code snippet assumes that a collection named `book` already exists and an index is to be created on the string field `book_name`.

<div class="multipleCode">
<a href="#python">Python </a>
<a href="#csharp">C#</a>
</div>

```python
from pymilvus import Collection

Expand All @@ -31,8 +36,19 @@ collection.create_index(
collection.load()
```

```csharp
var collection = milvusClient.GetCollection("book");
await collection.CreateIndexAsync("book_name", indexName: "scalar_index");
await collection.LoadAsync();
```

Once the index has been created, you can include a boolean expression on this string field in a vector similarity search as follows:

<div class="multipleCode">
<a href="#python">Python </a>
<a href="#csharp">C#</a>
</div>

```python
search_param = {
"data": [[0.1, 0.2]],
Expand All @@ -44,6 +60,10 @@ search_param = {
res = collection.search(**search_param)
```

```csharp

```

## What's next

- To learn more about scalar field indexing, read [Scalar Index](scalar_index.md).
Expand Down
Loading

0 comments on commit 78a3e51

Please sign in to comment.