Skip to content

Commit ee3dfa9

Browse files
committed
Use isa operator in cloud ndiquery live tests
The cloud search API no longer exposes document_class.class_name as a directly searchable field path. Class filtering now has to go through the 'isa' operator, which also rolls up subclasses. This was causing test_ndiqueryAll_paginates to return zero documents against the live server. Only the two cloud ndiquery tests are affected. Inline document bodies (e.g. {"document_class": {"class_name": "..."}}) and local session.database_search calls continue to use the field directly since they are not cloud search structures.
1 parent 15d5cee commit ee3dfa9

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

tests/test_cloud_live.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -794,13 +794,9 @@ def test_ndiquery_public(self, client):
794794
"""ndiquery should return documents matching a search."""
795795
from ndi.cloud.api.documents import ndiquery
796796

797-
search = [
798-
{
799-
"field": "document_class.class_name",
800-
"operation": "exact_string",
801-
"param1": "session",
802-
}
803-
]
797+
# Class filtering on the cloud must go through the 'isa' operator;
798+
# the document_class.class_name field path is no longer searchable.
799+
search = [{"field": "", "operation": "isa", "param1": "session"}]
804800
result = _retry_on_server_error(
805801
lambda: ndiquery("public", search, page=1, page_size=5, client=client)
806802
)
@@ -828,13 +824,9 @@ def test_ndiqueryAll_paginates(self, client):
828824
"""ndiqueryAll should auto-paginate results."""
829825
from ndi.cloud.api.documents import ndiqueryAll
830826

831-
search = [
832-
{
833-
"field": "document_class.class_name",
834-
"operation": "exact_string",
835-
"param1": "session",
836-
}
837-
]
827+
# Class filtering on the cloud must go through the 'isa' operator;
828+
# the document_class.class_name field path is no longer searchable.
829+
search = [{"field": "", "operation": "isa", "param1": "session"}]
838830
result = _retry_on_server_error(
839831
lambda: ndiqueryAll("public", search, page_size=3, client=client)
840832
)

0 commit comments

Comments
 (0)