mirror of
https://github.com/qdrant/qdrant.git
synced 2026-09-27 16:37:42 -05:00
* remove depricated fields from API * fmt * upd openapi and integration tests * fix grpc test * regenerate storage reference data * improve docs Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
75 lines
2.2 KiB
Python
75 lines
2.2 KiB
Python
import pytest
|
|
|
|
from .helpers.helpers import request_with_validation
|
|
from .helpers.collection_setup import basic_collection_setup, drop_collection
|
|
|
|
collection_name = 'test_collection_payload_indexing'
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def setup():
|
|
basic_collection_setup(collection_name=collection_name)
|
|
yield
|
|
drop_collection(collection_name=collection_name)
|
|
|
|
|
|
def test_payload_indexing_operations():
|
|
# create payload
|
|
response = request_with_validation(
|
|
api='/collections/{collection_name}/points/payload',
|
|
method="POST",
|
|
path_params={'collection_name': collection_name},
|
|
query_params={'wait': 'true'},
|
|
body={
|
|
"payload": {"test_payload": "keyword"},
|
|
"points": [6]
|
|
}
|
|
)
|
|
assert response.ok
|
|
|
|
response = request_with_validation(
|
|
api='/collections/{collection_name}',
|
|
method="GET",
|
|
path_params={'collection_name': collection_name},
|
|
)
|
|
assert response.ok
|
|
|
|
# Create index
|
|
response = request_with_validation(
|
|
api='/collections/{collection_name}/index',
|
|
method="PUT",
|
|
path_params={'collection_name': collection_name},
|
|
query_params={'wait': 'true'},
|
|
body={
|
|
"field_name": "test_payload",
|
|
"field_schema": "keyword"
|
|
}
|
|
)
|
|
assert response.ok
|
|
|
|
response = request_with_validation(
|
|
api='/collections/{collection_name}',
|
|
method="GET",
|
|
path_params={'collection_name': collection_name},
|
|
)
|
|
assert response.ok
|
|
assert response.json()['result']['payload_schema']['test_payload']['data_type'] == "keyword"
|
|
|
|
# Delete index
|
|
response = request_with_validation(
|
|
api='/collections/{collection_name}/index/{field_name}',
|
|
method="DELETE",
|
|
path_params={'collection_name': collection_name, 'field_name': 'test_payload'},
|
|
query_params={'wait': 'true'},
|
|
)
|
|
assert response.ok
|
|
|
|
response = request_with_validation(
|
|
api='/collections/{collection_name}',
|
|
method="GET",
|
|
path_params={'collection_name': collection_name},
|
|
)
|
|
assert response.ok
|
|
assert len(response.json()['result']['payload_schema']) == 0
|
|
|