Skip to content

Commit b0bd2a7

Browse files
Merge branch 'main' into vector-search-embedder
2 parents fb45587 + 24d4d7f commit b0bd2a7

File tree

6 files changed

+20
-38
lines changed

6 files changed

+20
-38
lines changed

.code-samples.meilisearch.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ primary_field_guide_add_document_primary_key: |-
10481048
getting_started_add_documents_md: |-
10491049
```toml
10501050
[dependencies]
1051-
meilisearch-sdk = "0.27.1"
1051+
meilisearch-sdk = "0.28.0"
10521052
# futures: because we want to block on futures
10531053
futures = "0.3"
10541054
# serde: required if you are going to use documents
@@ -1649,8 +1649,8 @@ get_experimental_features_1: |-
16491649
.unwrap();
16501650
update_experimental_features_1: |-
16511651
let client = Client::new("http://localhost:7700", Some("apiKey"));
1652-
let mut features = ExperimentalFeatures::new(&client);
1653-
features.set_vector_store(true);
1652+
let features = ExperimentalFeatures::new(&client);
1653+
// update the feature you want here
16541654
let res = features
16551655
.update()
16561656
.await

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "meilisearch-sdk"
3-
version = "0.27.1"
3+
version = "0.28.0"
44
authors = ["Mubelotix <[email protected]>"]
55
edition = "2018"
66
description = "Rust wrapper for the Meilisearch API. Meilisearch is a powerful, fast, open-source, easy to use and deploy search engine."
@@ -22,7 +22,7 @@ time = { version = "0.3.7", features = ["serde-well-known", "formatting", "parsi
2222
yaup = "0.3.1"
2323
either = { version = "1.8.0", features = ["serde"] }
2424
thiserror = "1.0.37"
25-
meilisearch-index-setting-macro = { path = "meilisearch-index-setting-macro", version = "0.27.1" }
25+
meilisearch-index-setting-macro = { path = "meilisearch-index-setting-macro", version = "0.28.0" }
2626
pin-project-lite = { version = "0.2.13", optional = true }
2727
reqwest = { version = "0.12.3", optional = true, default-features = false, features = ["rustls-tls", "http2", "stream"] }
2828
bytes = { version = "1.6", optional = true }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ To use `meilisearch-sdk`, add this to your `Cargo.toml`:
5353

5454
```toml
5555
[dependencies]
56-
meilisearch-sdk = "0.27.1"
56+
meilisearch-sdk = "0.28.0"
5757
```
5858

5959
The following optional dependencies may also be useful:

README.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ To use `meilisearch-sdk`, add this to your `Cargo.toml`:
5353

5454
```toml
5555
[dependencies]
56-
meilisearch-sdk = "0.27.1"
56+
meilisearch-sdk = "0.28.0"
5757
```
5858

5959
The following optional dependencies may also be useful:

meilisearch-index-setting-macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "meilisearch-index-setting-macro"
3-
version = "0.27.1"
3+
version = "0.28.0"
44
description = "Helper tool to generate settings of a Meilisearch index"
55
edition = "2021"
66
license = "MIT"

src/features.rs

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ use serde::{Deserialize, Serialize};
88
/// Struct representing the experimental features result from the API.
99
#[derive(Clone, Debug, Deserialize)]
1010
#[serde(rename_all = "camelCase")]
11-
pub struct ExperimentalFeaturesResult {
12-
pub vector_store: bool,
13-
}
11+
pub struct ExperimentalFeaturesResult {}
1412

1513
/// Struct representing the experimental features request.
1614
///
@@ -24,29 +22,18 @@ pub struct ExperimentalFeaturesResult {
2422
/// # let MEILISEARCH_API_KEY = option_env!("MEILISEARCH_API_KEY").unwrap_or("masterKey");
2523
/// # let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY)).unwrap();
2624
/// let mut features = ExperimentalFeatures::new(&client);
27-
/// features.set_vector_store(true);
2825
/// ```
2926
#[derive(Debug, Serialize)]
3027
#[serde(rename_all = "camelCase")]
3128
pub struct ExperimentalFeatures<'a, Http: HttpClient> {
3229
#[serde(skip_serializing)]
3330
client: &'a Client<Http>,
34-
#[serde(skip_serializing_if = "Option::is_none")]
35-
pub vector_store: Option<bool>,
3631
}
3732

3833
impl<'a, Http: HttpClient> ExperimentalFeatures<'a, Http> {
3934
#[must_use]
4035
pub fn new(client: &'a Client<Http>) -> Self {
41-
ExperimentalFeatures {
42-
client,
43-
vector_store: None,
44-
}
45-
}
46-
47-
pub fn set_vector_store(&mut self, vector_store: bool) -> &mut Self {
48-
self.vector_store = Some(vector_store);
49-
self
36+
ExperimentalFeatures { client }
5037
}
5138

5239
/// Get all the experimental features
@@ -83,11 +70,10 @@ impl<'a, Http: HttpClient> ExperimentalFeatures<'a, Http> {
8370
/// # let MEILISEARCH_URL = option_env!("MEILISEARCH_URL").unwrap_or("http://localhost:7700");
8471
/// # let MEILISEARCH_API_KEY = option_env!("MEILISEARCH_API_KEY").unwrap_or("masterKey");
8572
/// # let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY)).unwrap();
86-
/// tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(async {
87-
/// let mut features = ExperimentalFeatures::new(&client);
88-
/// features.set_vector_store(true);
89-
/// features.update().await.unwrap();
90-
/// });
73+
/// # tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(async {
74+
/// let features = ExperimentalFeatures::new(&client);
75+
/// features.update().await.unwrap();
76+
/// # });
9177
/// ```
9278
pub async fn update(&self) -> Result<ExperimentalFeaturesResult, Error> {
9379
self.client
@@ -109,17 +95,13 @@ mod tests {
10995
use super::*;
11096
use meilisearch_test_macro::meilisearch_test;
11197

112-
/// there is purposely no test which disables this feature to prevent impact on other testcases
113-
/// the setting is shared amongst all indexes
11498
#[meilisearch_test]
115-
async fn test_experimental_features_enable_vector_store(client: Client) {
116-
let mut features = ExperimentalFeatures::new(&client);
117-
features.set_vector_store(true);
118-
119-
let res = features.update().await.unwrap();
120-
assert!(res.vector_store);
99+
async fn test_experimental_features_get(client: Client) {
100+
let features = ExperimentalFeatures::new(&client);
101+
// set feature here, once some exist again
102+
let _ = features.update().await.unwrap();
121103

122-
let res = features.get().await.unwrap();
123-
assert!(res.vector_store);
104+
let _res = features.get().await.unwrap();
105+
// assert that the feature has been set once they exist again
124106
}
125107
}

0 commit comments

Comments
 (0)