mirror of https://github.com/milvus-io/milvus.git
Updated Getting started (markdown)
parent
6f55fa4d10
commit
b9ab00fece
|
@ -180,3 +180,33 @@ await milvusClient.dataManager.search({
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Querying
|
||||||
|
|
||||||
|
This topic describes how to conduct a query.
|
||||||
|
|
||||||
|
In addition to vectors, Milvus supports data types such as boolean, integers, floating-point numbers, and more.
|
||||||
|
|
||||||
|
A query is a search on all existing data. In Milvus, you can run a query which will return all the results that meet your specified requirements. Use boolean expression to specify the requirements.
|
||||||
|
|
||||||
|
|
||||||
|
In Python
|
||||||
|
|
||||||
|
```
|
||||||
|
expr = "id in [2,4,6,8]"
|
||||||
|
output_fields = ["id", "vector"]
|
||||||
|
res = collection.query(expr, output_fields)
|
||||||
|
# check the results
|
||||||
|
sorted_res = sorted(res, key=lambda k: k['film_id'])
|
||||||
|
print(sorted_res)
|
||||||
|
```
|
||||||
|
|
||||||
|
In Node
|
||||||
|
|
||||||
|
```
|
||||||
|
await milvusClient.dataManager.query({
|
||||||
|
collection_name: COLLECTION_NAME,
|
||||||
|
expr: "id in [2,4,6,8]",
|
||||||
|
output_fields: ["id", "vector"],
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue