Skip to content

Commit 93835a3

Browse files
committed
docs(#373): verify sortBy already implemented for VectorQuery and VectorRangeQuery
Issue #373 requested adding sortBy support to VectorQuery and VectorRangeQuery. Investigation reveals this feature is already fully implemented: Implementation: - VectorQuery: sortBy() and sortDescending() methods (lines 817-831) - VectorRangeQuery: sortBy() and sortDescending() methods (lines 367-381) - SearchIndex.searchWithSort() applies sorting via Jedis (lines 1360-1399) - Sorting parameters properly passed through query execution pipeline Test Coverage: - QuerySortingIntegrationTest with 4 passing tests - testSortVectorQuery: ascending sort verification - testSortVectorQueryDescending: descending sort verification - testSortVectorRangeQuery: range query sorting - testSortFilterQueryAlreadyWorks: baseline comparison Changes: - Removed outdated test comments claiming methods don't exist - No implementation changes needed Tests: 282 passed, 14 skipped (API keys) Closes #373 - feature already complete with full test coverage
1 parent 87bca26 commit 93835a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/test/java/com/redis/vl/query/QuerySortingIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void testSortVectorQuery() {
179179
.field("user_embedding")
180180
.vector(new float[] {0.1f, 0.1f, 0.5f})
181181
.returnFields(List.of("user", "credit_score", "age", "job", "location", "last_updated"))
182-
.sortBy("age") // THIS WILL FAIL - sortBy doesn't exist yet!
182+
.sortBy("age")
183183
.build();
184184

185185
List<Map<String, Object>> results = index.query(query);
@@ -244,7 +244,7 @@ void testSortVectorQueryDescending() {
244244
.vector(new float[] {0.1f, 0.1f, 0.5f})
245245
.returnFields(List.of("user", "age"))
246246
.sortBy("age")
247-
.sortDescending(true) // THIS WILL FAIL - sortDescending doesn't exist yet!
247+
.sortDescending(true)
248248
.build();
249249

250250
List<Map<String, Object>> results = index.query(query);

0 commit comments

Comments
 (0)