-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Indexing options] Changes for find collections to return indexing option #779
Changes from all commits
ddf0654
9844977
4988227
8646f30
322bff0
db3c207
a04ebc9
f16059d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,9 @@ public void happyPathWithExplain() { | |
"vector": { | ||
"dimension": 5, | ||
"metric": "cosine" | ||
}, | ||
"indexing": { | ||
"deny" : ["comment"] | ||
} | ||
} | ||
} | ||
|
@@ -117,6 +120,8 @@ public void happyPathWithExplain() { | |
"vector": { | ||
"dimension": 5, | ||
"metric": "cosine" | ||
},"indexing": { | ||
"deny" : ["comment"] | ||
} | ||
} | ||
} | ||
|
@@ -304,6 +309,77 @@ public void notExistingNamespace() { | |
"errors[0].message", | ||
is("Unknown namespace should_not_be_there, you must create it first.")); | ||
} | ||
|
||
@Test | ||
@Order(7) | ||
public void happyPathIndexingWithExplain() { | ||
String json = | ||
""" | ||
{ | ||
"createCollection": { | ||
"name": "%s", | ||
"options": { | ||
"indexing": { | ||
"deny" : ["comment"] | ||
} | ||
} | ||
} | ||
} | ||
""" | ||
.formatted("collection4"); | ||
|
||
given() | ||
.header(HttpConstants.AUTHENTICATION_TOKEN_HEADER_NAME, getAuthToken()) | ||
.contentType(ContentType.JSON) | ||
.body(json) | ||
.when() | ||
.post(NamespaceResource.BASE_PATH, namespaceName) | ||
.then() | ||
.statusCode(200) | ||
.body("status.ok", is(1)); | ||
|
||
String expected1 = """ | ||
{"name":"TableName"} | ||
"""; | ||
String expected2 = """ | ||
{"name":"collection1"} | ||
"""; | ||
String expected3 = | ||
""" | ||
{"name":"collection2", "options": {"vector": {"dimension":5, "metric":"cosine"}, "indexing":{"deny":["comment"]}}} | ||
"""; | ||
String expected4 = | ||
""" | ||
{"name":"collection4", "options":{"indexing":{"deny":["comment"]}}} | ||
"""; | ||
json = | ||
""" | ||
{ | ||
"findCollections": { | ||
"options": { | ||
"explain" : true | ||
} | ||
} | ||
} | ||
"""; | ||
|
||
given() | ||
.header(HttpConstants.AUTHENTICATION_TOKEN_HEADER_NAME, getAuthToken()) | ||
.contentType(ContentType.JSON) | ||
.body(json) | ||
.when() | ||
.post(NamespaceResource.BASE_PATH, namespaceName) | ||
.then() | ||
.statusCode(200) | ||
.body("status.collections", hasSize(4)) | ||
.body( | ||
"status.collections", | ||
containsInAnyOrder( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought we only expect 'expected4' here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. find collection returns all the collection created thus far. So add all 4. |
||
jsonEquals(expected1), | ||
jsonEquals(expected2), | ||
jsonEquals(expected3), | ||
jsonEquals(expected4))); | ||
} | ||
} | ||
|
||
@Nested | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also use
JsonInclude.Include.NON_EMPTY
which would exclude emptyCollection
s.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah., got it I will change it.