Repository: meilisearch/meilisearch
File: crates/meilisearch/src/search/mod.rs (Rust)

Code before:
            matching_strategy,
            attributes_to_search_on,
            hybrid,
            ranking_score_threshold,
            locales,
            personalize,
            use_network,
        } = self;
        (
            index_uid,
            SearchQuery {
                q,
                vector,
                media,
                offset: offset.unwrap_or(DEFAULT_SEARCH_OFFSET()),
                limit: limit.unwrap_or(DEFAULT_SEARCH_LIMIT()),
                page,
                hits_per_page,
                attributes_to_retrieve,
                retrieve_vectors,
                attributes_to_crop,
                crop_length,
                attributes_to_highlight,
                show_ranking_score,
                show_ranking_score_details,
                show_performance_details: show_performance_details.unwrap_or(false),
                show_matches_position,
                filter,
                sort,
                distinct,
                facets,
                highlight_pre_tag,
                highlight_post_tag,
                crop_marker,
                matching_strategy,
                attributes_to_search_on,
                hybrid,
                ranking_score_threshold,
                locales,
                personalize,
                use_network,
                // do not use ..Default::default() here,
                // rather add any missing field from `SearchQuery` to `SearchQueryWithIndex`
            },
            federation_options,
        )
    }
}

/// Request body for similar document search
#[derive(Debug, Clone, PartialEq, Deserr, ToSchema)]

Review comment (performance):
```suggestion
                show_performance_details: show_performance_details.unwrap_or_default(),
```

Code after:
            matching_strategy,
            attributes_to_search_on,
            hybrid,
            ranking_score_threshold,
            locales,
            personalize,
            use_network,
        } = self;
        (
            index_uid,
            SearchQuery {
                q,
                vector,
                media,
                offset: offset.unwrap_or(DEFAULT_SEARCH_OFFSET()),
                limit: limit.unwrap_or(DEFAULT_SEARCH_LIMIT()),
                page,
                hits_per_page,
                attributes_to_retrieve,
                retrieve_vectors,
                attributes_to_crop,
                crop_length,
                attributes_to_highlight,
                show_ranking_score,
                show_ranking_score_details,
                show_performance_details: show_performance_details.unwrap_or_default(),
                show_matches_position,
                filter,
                sort,
                distinct,
                facets,
                highlight_pre_tag,
                highlight_post_tag,
                crop_marker,
                matching_strategy,
                attributes_to_search_on,
                hybrid,
                ranking_score_threshold,
                locales,
                personalize,
                use_network,
                // do not use ..Default::default() here,
                // rather add any missing field from `SearchQuery` to `SearchQueryWithIndex`
            },
            federation_options,
        )
    }
}

/// Request body for similar document search
#[derive(Debug, Clone, PartialEq, Deserr, ToSchema)]