Skip to content

Commit

Permalink
feat: search filter expression (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
honeyAcorn authored Dec 14, 2023
1 parent dd81415 commit 893d08a
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions proto/vectorindex.proto
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,81 @@ message _MetadataRequest {
}
}

message _AndExpression {
_FilterExpression first_expression = 1;
_FilterExpression second_expression = 2;
}

message _OrExpression {
_FilterExpression first_expression = 1;
_FilterExpression second_expression = 2;
}

message _NotExpression {
_FilterExpression expression_to_negate = 1;
}

message _EqualsExpression {
string field = 1;
oneof value {
string string_value = 2;
int64 integer_value = 3;
float float_value = 4;
bool boolean_value = 5;
}
}

message _GreaterThanExpression {
string field = 1;
oneof value {
int64 integer_value = 2;
float float_value = 3;
}
}

message _GreaterOrEqualExpression {
string field = 1;
oneof value {
int64 integer_value = 2;
float float_value = 3;
}
}

message _LessThanExpression {
string field = 1;
oneof value {
int64 integer_value = 2;
float float_value = 3;
}
}

message _LessOrEqualExpression {
string field = 1;
oneof value {
int64 integer_value = 2;
float float_value = 3;
}
}

message _ListContainsExpression {
string field = 1;
string value = 2;
}

message _FilterExpression {
oneof expression {
_EqualsExpression equals_expression = 1;
_AndExpression and_expression = 2;
_OrExpression or_expression = 3;
_NotExpression not_expression = 4;
_GreaterThanExpression greater_than_expression = 5;
_GreaterOrEqualExpression greater_or_equal_expression = 6;
_LessThanExpression less_than_expression = 7;
_LessOrEqualExpression less_or_equal_expression = 8;
_ListContainsExpression list_contains_expression = 9;
}
}

message _NoScoreThreshold {}

message _SearchRequest {
Expand All @@ -77,6 +152,7 @@ message _SearchRequest {
float score_threshold = 5;
_NoScoreThreshold no_score_threshold = 6;
}
_FilterExpression filter_expression = 7;
}

message _SearchAndFetchVectorsRequest {
Expand All @@ -88,6 +164,7 @@ message _SearchAndFetchVectorsRequest {
float score_threshold = 5;
_NoScoreThreshold no_score_threshold = 6;
}
_FilterExpression filter_expression = 7;
}

message _SearchHit {
Expand Down

0 comments on commit 893d08a

Please sign in to comment.