Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
Signed-off-by: liyun95 <[email protected]>
  • Loading branch information
liyun95 committed Dec 4, 2024
1 parent ec97ee8 commit 8dd91f0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions site/en/userGuide/search-query-get/full-text-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ First, create the schema and add the necessary fields:​

```python
from pymilvus import MilvusClient, DataType, Function, FunctionType​

client = MilvusClient(uri="http://localhost:19530")
schema = MilvusClient.create_schema()​
schema = client.create_schema()​
schema.add_field(field_name="id", datatype=DataType.INT64, is_primary=True, auto_id=True)​
schema.add_field(field_name="text", datatype=DataType.VARCHAR, max_length=1000, enable_analyzer=True)​
Expand Down Expand Up @@ -286,7 +288,7 @@ After defining the schema with necessary fields and the built-in function, set u
</div>

```python
index_params = MilvusClient.prepare_index_params()​
index_params = client.prepare_index_params()​
index_params.add_index(​
field_name="sparse",​
Expand Down Expand Up @@ -357,7 +359,7 @@ Now create the collection using the schema and index parameters defined.​
</div>

```python
MilvusClient.create_collection(​
client.create_collection(​
collection_name='demo', ​
schema=schema, ​
index_params=index_params​
Expand Down Expand Up @@ -477,10 +479,10 @@ Once you've inserted data into your collection, you can perform full text search
```python
search_params = {​
'params': {'drop_ratio_search': 0.6},​
'params': {'drop_ratio_search': 0.2},​
}​
MilvusClient.search(​
client.search(​
collection_name='demo', ​
data=['whats the focus of information retrieval?'],​
anns_field='sparse',​
Expand All @@ -496,7 +498,7 @@ import io.milvus.v2.service.vector.request.data.EmbeddedText;
import io.milvus.v2.service.vector.response.SearchResp;

Map<String,Object> searchParams = new HashMap<>();
searchParams.put("drop_ratio_search", 0.6);
searchParams.put("drop_ratio_search", 0.2);
SearchResp searchResp = client.search(SearchReq.builder()
.collectionName("demo")
.data(Collections.singletonList(new EmbeddedText("whats the focus of information retrieval?")))
Expand All @@ -513,7 +515,7 @@ await client.search(
data: ['whats the focus of information retrieval?'],
anns_field: 'sparse',
limit: 3,
params: {'drop_ratio_search': 0.6},
params: {'drop_ratio_search': 0.2},
)
```
Expand All @@ -534,7 +536,7 @@ curl --request POST \
],
"searchParams":{
"params":{
"drop_ratio_search":0.6
"drop_ratio_search":0.2
}
}
}'
Expand Down

0 comments on commit 8dd91f0

Please sign in to comment.