[go: up one dir, main page]

Skip to content
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

Merged
merged 4 commits into from
Sep 25, 2024
Merged

[Strict mode] default config #5037

merged 4 commits into from
Sep 25, 2024

Conversation

JojiiOfficial
Copy link
Contributor

Depends on #5003

Since we need the strict mode config struct to be in /lib/segment but also need a struct that derives Merge, I decided to create two structs for strict mode: StrictModeDiff and StrictMode.

config/config.yaml Show resolved Hide resolved
Comment on lines +669 to +672
// Global
/// Whether strict mode is enabled for a collection or not.
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
Copy link
Member

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.

Comment on lines +1758 to +1774
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),
}
}
}
Copy link
Member

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.

Comment on lines +667 to +668
#[derive(Debug, Deserialize, Serialize, JsonSchema, Validate, Clone, PartialEq, Default)]
pub struct StrictModeConfig {
Copy link
Member

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?

@JojiiOfficial JojiiOfficial force-pushed the strict_mode_for_grpc branch 2 times, most recently from 4ae2a7b to 2551585 Compare September 23, 2024 12:06
Base automatically changed from strict_mode_for_grpc to dev September 25, 2024 11:22
@JojiiOfficial JojiiOfficial merged commit 791d064 into dev Sep 25, 2024
17 checks passed
@JojiiOfficial JojiiOfficial deleted the strict_mode_default_config branch September 25, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants