From 7a2acafa248ed516aa7208359421ffd64150abc8 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Wed, 17 Apr 2024 09:22:30 -0700 Subject: [PATCH] Fixes #1032, re-does #1005: exclude $vector and $vectorize from default projection --- .../service/projection/DocumentProjector.java | 14 ++------------ .../v1/FindOneAndUpdateNoIndexIntegrationTest.java | 1 - .../service/projection/DocumentProjectorTest.java | 2 -- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/projection/DocumentProjector.java b/src/main/java/io/stargate/sgv2/jsonapi/service/projection/DocumentProjector.java index c59f5d438c..821c4e2e16 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/projection/DocumentProjector.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/projection/DocumentProjector.java @@ -52,21 +52,11 @@ private DocumentProjector( } public static DocumentProjector defaultProjector() { - /* 16-Apr-2024, tatu: For v1.0.6 need to revert to default being - "include all", and then go back to "exclude $vector/$vectorize" - for v1.0.7 or later. - */ - // return DefaultProjectorWrapper.defaultProjector(); - return INCLUDE_ALL_PROJECTOR; + return DefaultProjectorWrapper.defaultProjector(); } public static DocumentProjector defaultProjectorWithSimilarity() { - /* 16-Apr-2024, tatu: For v1.0.6 need to revert to default being - "include all", and then go back to "exclude $vector/$vectorize" - for v1.0.7 or later. - */ - // return DefaultProjectorWrapper.defaultProjectorWithSimilarity(); - return INCLUDE_ALL_PROJECTOR_WITH_SIMILARITY; + return DefaultProjectorWrapper.defaultProjectorWithSimilarity(); } public static DocumentProjector includeAllProjector() { diff --git a/src/test/java/io/stargate/sgv2/jsonapi/api/v1/FindOneAndUpdateNoIndexIntegrationTest.java b/src/test/java/io/stargate/sgv2/jsonapi/api/v1/FindOneAndUpdateNoIndexIntegrationTest.java index 61dda88a10..4ee6c3bbf3 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/api/v1/FindOneAndUpdateNoIndexIntegrationTest.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/api/v1/FindOneAndUpdateNoIndexIntegrationTest.java @@ -124,7 +124,6 @@ public void byIdAfterUpdate() { "name": "Joe", "age": 42, "enabled": true, - "$vector" : [ 0.5, -0.25 ], "value": -1 } """)) diff --git a/src/test/java/io/stargate/sgv2/jsonapi/service/projection/DocumentProjectorTest.java b/src/test/java/io/stargate/sgv2/jsonapi/service/projection/DocumentProjectorTest.java index b79a91cd99..70b2ec23d5 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/service/projection/DocumentProjectorTest.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/service/projection/DocumentProjectorTest.java @@ -310,8 +310,6 @@ public void defaultProjectionMixAll() throws Exception { { "_id" : 1, "value1": 42, - "$vectorize": "Quick brown fox", - "$vector": [0.0, 1.0], "value2": -3 } """));