Skip to content

Commit

Permalink
test: separate test for order-by scroll (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 authored Jun 20, 2024
1 parent 961595d commit 6aacf71
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
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

0 comments on commit 6aacf71

Please sign in to comment.