Skip to content
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

test: separate test for order-by scroll #43

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# The version of qdrant to use to download protos
qdrantProtosVersion=v1.9.2
qdrantProtosVersion=v1.9.5

# The version of qdrant docker image to run integration tests against
qdrantVersion=v1.9.2
qdrantVersion=v1.9.5

# The version of the client to generate
packageVersion=1.9.1
44 changes: 27 additions & 17 deletions src/test/java/io/qdrant/client/PointsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,22 +363,6 @@ public void searchGroups() throws ExecutionException, InterruptedException {
public void scroll() throws ExecutionException, InterruptedException {
createAndSeedCollection(testName);

Collections.PayloadIndexParams params = Collections.PayloadIndexParams.newBuilder()
.setIntegerIndexParams(
Collections.IntegerIndexParams.newBuilder().setLookup(false).setRange(true).build())
.build();

UpdateResult resultIndex = client.createPayloadIndexAsync(
testName,
"bar",
PayloadSchemaType.Integer,
params,
true,
null,
null).get();

assertEquals(UpdateStatus.Completed, resultIndex.getStatus());

ScrollResponse scrollResponse = client.scrollAsync(ScrollPoints.newBuilder()
.setCollectionName(testName)
.setLimit(1)
Expand All @@ -397,8 +381,32 @@ public void scroll() throws ExecutionException, InterruptedException {

assertEquals(1, scrollResponse.getResultCount());
assertFalse(scrollResponse.hasNextPageOffset());
}

scrollResponse = client.scrollAsync(ScrollPoints.newBuilder()
@Test
public void scrollWithOrdering() throws ExecutionException, InterruptedException {
createAndSeedCollection(testName);

Collections.PayloadIndexParams params = Collections.PayloadIndexParams.newBuilder()
.setIntegerIndexParams(
Collections.IntegerIndexParams.newBuilder().setLookup(false).setRange(true).build())
.build();

UpdateResult resultIndex = client.createPayloadIndexAsync(
testName,
"bar",
PayloadSchemaType.Integer,
params,
true,
null,
null).get();

assertEquals(UpdateStatus.Completed, resultIndex.getStatus());

CollectionInfo collectionInfo = client.getCollectionInfoAsync(testName).get();
assertEquals(ImmutableSet.of("bar"), collectionInfo.getPayloadSchemaMap().keySet());

ScrollResponse scrollResponse = client.scrollAsync(ScrollPoints.newBuilder()
.setCollectionName(testName)
.setLimit(1)
.setOrderBy(Points.OrderBy.newBuilder()
Expand All @@ -407,8 +415,10 @@ public void scroll() throws ExecutionException, InterruptedException {
.build()
).get();


assertEquals(1, scrollResponse.getResultCount());
assertFalse(scrollResponse.hasNextPageOffset());
assertEquals(scrollResponse.getResult(0).getId(), id(9));
}

@Test
Expand Down
Loading