Skip to content

Commit

Permalink
Adjust GeoIndexParams and fix warnings when compiling tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JojiiOfficial committed Oct 7, 2024
1 parent cd287d8 commit 6188ac0
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions proto/collections.proto
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ message FloatIndexParams {
}

message GeoIndexParams {
optional bool on_disk = 1; // If true - store index on disk.
}

message TextIndexParams {
Expand Down
13 changes: 12 additions & 1 deletion src/qdrant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,18 @@ pub struct FloatIndexParams {
#[builder(default, setter(strip_option), field(vis = "pub(crate)"))]
pub is_principal: ::core::option::Option<bool>,
}
#[derive(derive_builder::Builder)]
#[builder(
build_fn(private, error = "std::convert::Infallible", name = "build_inner"),
pattern = "owned"
)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GeoIndexParams {}
pub struct GeoIndexParams {
/// If true - store index on disk.
#[prost(bool, optional, tag = "1")]
#[builder(default, setter(strip_option), field(vis = "pub(crate)"))]
pub on_disk: ::core::option::Option<bool>,
}
#[derive(derive_builder::Builder)]
#[builder(
build_fn(private, name = "build_inner"),
Expand Down Expand Up @@ -9409,6 +9419,7 @@ builder_type_conversions!(KeywordIndexParams, KeywordIndexParamsBuilder);
builder_type_conversions!(DatetimeIndexParams, DatetimeIndexParamsBuilder);
builder_type_conversions!(UuidIndexParams, UuidIndexParamsBuilder);
builder_type_conversions!(FloatIndexParams, FloatIndexParamsBuilder);
builder_type_conversions!(GeoIndexParams, GeoIndexParamsBuilder);
builder_type_conversions!(CreateAlias, CreateAliasBuilder, true);
builder_type_conversions!(RenameAlias, RenameAliasBuilder, true);
builder_type_conversions!(DeleteSnapshotRequest, DeleteSnapshotRequestBuilder, true);
Expand Down
7 changes: 7 additions & 0 deletions tests/protos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,8 @@ fn configure_builder(builder: Builder) -> Builder {
// FloatIndexParams
("FloatIndexParams.is_principal", DEFAULT_OPTION),
("FloatIndexParams.on_disk", DEFAULT_OPTION),
// GeoIndexParams
("GeoIndexParams.on_disk", DEFAULT_OPTION),
// DatetimeIndexParams
("DatetimeIndexParams.is_principal", DEFAULT_OPTION),
("DatetimeIndexParams.on_disk", DEFAULT_OPTION),
Expand Down Expand Up @@ -1099,6 +1101,11 @@ fn builder_derive_options() -> &'static [BuildDeriveOptions] {
DEFAULT_BUILDER_DERIVE_OPTIONS,
MacroConfig::DefaultImpl,
),
(
"GeoIndexParams",
DEFAULT_BUILDER_DERIVE_OPTIONS,
MacroConfig::DefaultImpl,
),
(
"CreateAlias",
NO_DEFAULT_BUILDER_DERIVE_OPTIONS,
Expand Down
2 changes: 1 addition & 1 deletion tests/snippet_tests/test_facets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async fn test_facets() {

let client = Qdrant::from_url("http://localhost:6334").build()?;

let ten_countries_with_most_poins_in_europe = client
client
.facet(
FacetCountsBuilder::new("world_data", "country")
.limit(10)
Expand Down
2 changes: 1 addition & 1 deletion tests/snippet_tests/test_search_matrix_offsets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async fn test_search_matrix_offsets() {

let client = Qdrant::from_url("http://localhost:6334").build()?;

let matrix = client
client
.search_matrix_offsets(
SearchMatrixPointsBuilder::new("collection_name")
.filter(Filter::must(vec![Condition::matches(
Expand Down
2 changes: 1 addition & 1 deletion tests/snippet_tests/test_search_matrix_pairs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async fn test_search_matrix_pairs() {

let client = Qdrant::from_url("http://localhost:6334").build()?;

let matrix = client
client
.search_matrix_pairs(
SearchMatrixPointsBuilder::new("collection_name")
.filter(Filter::must(vec![Condition::matches(
Expand Down

0 comments on commit 6188ac0

Please sign in to comment.