Skip to content

Commit

Permalink
Adjust Oracle Vector store class names
Browse files Browse the repository at this point in the history
  • Loading branch information
tzolov committed Jun 14, 2024
1 parent 41cf693 commit a5d92ec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public enum OracleAIVectorSearchDistanceType {

private final boolean removeExistingVectorStoreTable;

public final FilterExpressionConverter filterExpressionConverter = new IsoSqlJsonPathFilterExpressionConverter();
public final FilterExpressionConverter filterExpressionConverter = new SqlJsonPathFilterExpressionConverter();

/**
* Table name where vectors will be stored.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* "https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-path-expressions.html#GUID-8656CAB9-C293-4A99-BB62-F38F3CFC4C13">JSON
* Path Documentation</a>
*/
public class IsoSqlJsonPathFilterExpressionConverter extends AbstractFilterExpressionConverter {
public class SqlJsonPathFilterExpressionConverter extends AbstractFilterExpressionConverter {

@Override
protected String convertOperand(final Filter.Operand operand) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import org.springframework.ai.vectorstore.filter.Filter;
import org.springframework.ai.vectorstore.filter.FilterExpressionTextParser;

public class IsoSqlJsonPathFilterExpressionConverterTests {
public class SqlJsonPathFilterExpressionConverterTests {

@Test
public void testNIN() {
final Filter.Expression e = new FilterExpressionTextParser().parse("weather nin [\"windy\", \"rainy\"]");

final String jsonPathExpression = new IsoSqlJsonPathFilterExpressionConverter().convertExpression(e);
final String jsonPathExpression = new SqlJsonPathFilterExpressionConverter().convertExpression(e);

assertThat(jsonPathExpression).isEqualTo("$?( !( @.weather in ( \"windy\",\"rainy\" ) ) )");
}
Expand All @@ -21,7 +21,7 @@ public void testNIN() {
public void testNOT() {
final Filter.Expression e = new FilterExpressionTextParser().parse("NOT( weather in [\"windy\", \"rainy\"] )");

final String jsonPathExpression = new IsoSqlJsonPathFilterExpressionConverter().convertExpression(e);
final String jsonPathExpression = new SqlJsonPathFilterExpressionConverter().convertExpression(e);

assertThat(jsonPathExpression).isEqualTo("$?( (!( @.weather in ( \"windy\",\"rainy\" ) )) )");
}
Expand Down

0 comments on commit a5d92ec

Please sign in to comment.