### Create collection # curl -X PUT 'http://localhost:6333/collections/test_collection' # -H 'Content-Type: application/json' # --data-raw '{ # "vectors": { # "size": 4, # "distance": "Dot" # } # }' PUT http://localhost:6333/collections/test_collection Content-Type: application/json { "vectors": { "size": 4, "distance": "Dot" } } ### 查询info # curl 'http://localhost:6333/collections/test_collection' GET http://localhost:6333/collections/test_collection ### Add points # curl -L -X PUT 'http://localhost:6333/collections/test_collection/points?wait=true' # -H 'Content-Type: application/json' # --data-raw '{ # "points": [ # {"id": 1, "vector": [0.05, 0.61, 0.76, 0.74], "payload": {"city": "Berlin"}}, # {"id": 2, "vector": [0.19, 0.81, 0.75, 0.11], "payload": {"city": ["Berlin", "London"] }}, # {"id": 3, "vector": [0.36, 0.55, 0.47, 0.94], "payload": {"city": ["Berlin", "Moscow"] }}, # {"id": 4, "vector": [0.18, 0.01, 0.85, 0.80], "payload": {"city": ["London", "Moscow"] }}, # {"id": 5, "vector": [0.24, 0.18, 0.22, 0.44], "payload": {"count": [0] }}, # {"id": 6, "vector": [0.35, 0.08, 0.11, 0.44]} # ] # }' PUT http://localhost:6333/collections/test_collection/points?wait=true Content-Type: application/json { "points": [ { "id": 1, "vector": [ 0.05, 0.61, 0.76, 0.74 ], "payload": { "city": "Berlin" } }, { "id": 2, "vector": [ 0.19, 0.81, 0.75, 0.11 ], "payload": { "city": [ "Berlin", "London" ] } }, { "id": 3, "vector": [ 0.36, 0.55, 0.47, 0.94 ], "payload": { "city": [ "Berlin", "Moscow" ] } }, { "id": 4, "vector": [ 0.18, 0.01, 0.85, 0.80 ], "payload": { "city": [ "London", "Moscow" ] } }, { "id": 5, "vector": [ 0.24, 0.18, 0.22, 0.44 ], "payload": { "count": [ 0 ] } }, { "id": 6, "vector": [ 0.35, 0.08, 0.11, 0.44 ] } ] } ### Search with filtering # curl -L -X POST 'http://localhost:6333/collections/test_collection/points/search' # -H 'Content-Type: application/json' # --data-raw '{ # "vector": [0.2,0.1,0.9,0.7], # "top": 3 # }' POST http://localhost:6333/collections/test_collection/points/search Content-Type: application/json { "vector": [ 0.2, 0.1, 0.9, 0.7 ], "top": 3 } ### add a filter # curl -L -X POST 'http://localhost:6333/collections/test_collection/points/search' # -H 'Content-Type: application/json' # --data-raw '{ # "filter": { # "should": [ # { # "key": "city", # "match": { # "value": "London" # } # } # ] # }, # "vector": [0.2, 0.1, 0.9, 0.7], # "top": 3 # }' POST http://localhost:6333/collections/test_collection/points/search Content-Type: application/json { "filter": { "should": [ { "key": "city", "match": { "value": "London" } } ] }, "vector": [ 0.2, 0.1, 0.9, 0.7 ], "top": 3 } ###