-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Strict mode] default config #5037
Conversation
// Global | ||
/// Whether strict mode is enabled for a collection or not. | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub enabled: Option<bool>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this non-optional? I guess it's good to be explicit here.
impl From<StrictModeConfigDiff> for segment::types::StrictModeConfig { | ||
fn from(value: StrictModeConfigDiff) -> Self { | ||
Self { | ||
enabled: value.enabled, | ||
max_query_limit: value.max_query_limit.map(|i| i as usize), | ||
max_timeout: value.max_timeout.map(|i| i as usize), | ||
unindexed_filtering_retrieve: value.unindexed_filtering_retrieve, | ||
unindexed_filtering_update: value.unindexed_filtering_update, | ||
search_max_hnsw_ef: value.search_max_hnsw_ef.map(|i| i as usize), | ||
search_allow_exact: value.search_allow_exact, | ||
search_max_oversampling: value.search_max_oversampling.map(f64::from), | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can construct a regular config from a diff, I don't see much reason to also have a diff type.
#[derive(Debug, Deserialize, Serialize, JsonSchema, Validate, Clone, PartialEq, Default)] | ||
pub struct StrictModeConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this time the -Diff struct of this appears to be exactly the same. In that case, does it make sense to use a diff structure at all?
4ae2a7b
to
2551585
Compare
d50301f
to
70e7d1f
Compare
2551585
to
9a392f8
Compare
70e7d1f
to
4a966cc
Compare
Depends on #5003
Since we need the strict mode config struct to be in
/lib/segment
but also need a struct that derivesMerge
, I decided to create two structs for strict mode: StrictModeDiff and StrictMode.