@@ -36,7 +36,8 @@ pub struct FacetingSettings {
36
36
pub max_values_per_facet : usize ,
37
37
}
38
38
39
- #[ cfg( feature = "experimental-vector-search" ) ]
39
+ /// EXPERIMENTAL
40
+ /// Allows configuring semantic seaarching
40
41
#[ derive( Serialize , Deserialize , Debug , Clone , Eq , PartialEq ) ]
41
42
#[ serde( rename_all = "camelCase" , tag = "source" ) ]
42
43
pub enum Embedder {
@@ -50,7 +51,6 @@ pub enum Embedder {
50
51
UserProvided ( UserProvidedEmbedderSettings ) ,
51
52
}
52
53
53
- #[ cfg( feature = "experimental-vector-search" ) ]
54
54
#[ derive( Serialize , Deserialize , Default , Debug , Clone , Eq , PartialEq ) ]
55
55
#[ serde( rename_all = "camelCase" ) ]
56
56
pub struct HuggingFaceEmbedderSettings {
@@ -69,7 +69,6 @@ pub struct HuggingFaceEmbedderSettings {
69
69
pub document_template : Option < String > ,
70
70
}
71
71
72
- #[ cfg( feature = "experimental-vector-search" ) ]
73
72
#[ derive( Serialize , Deserialize , Default , Debug , Clone , Eq , PartialEq ) ]
74
73
#[ serde( rename_all = "camelCase" ) ]
75
74
pub struct OpenapiEmbedderSettings {
@@ -93,7 +92,6 @@ pub struct OpenapiEmbedderSettings {
93
92
pub document_template : Option < String > ,
94
93
}
95
94
96
- #[ cfg( feature = "experimental-vector-search" ) ]
97
95
#[ derive( Serialize , Deserialize , Default , Debug , Clone , Eq , PartialEq , Copy ) ]
98
96
pub struct UserProvidedEmbedderSettings {
99
97
/// dimensions of your custom embedding
@@ -168,7 +166,6 @@ pub struct Settings {
168
166
#[ serde( skip_serializing_if = "Option::is_none" ) ]
169
167
pub proximity_precision : Option < String > ,
170
168
/// Settings how the embeddings for the experimental vector search feature are generated
171
- #[ cfg( feature = "experimental-vector-search" ) ]
172
169
#[ serde( skip_serializing_if = "Option::is_none" ) ]
173
170
pub embedders : Option < HashMap < String , Embedder > > ,
174
171
}
@@ -355,8 +352,9 @@ impl Settings {
355
352
}
356
353
}
357
354
355
+ /// EXPERIMENTAL
356
+ /// Set the [embedders](https://www.meilisearch.com/docs/learn/experimental/vector_search) of the [Index].
358
357
#[ must_use]
359
- #[ cfg( feature = "experimental-vector-search" ) ]
360
358
pub fn with_embedders < S > ( self , embedders : HashMap < S , Embedder > ) -> Settings
361
359
where
362
360
S : AsRef < str > ,
@@ -840,6 +838,7 @@ impl<Http: HttpClient> Index<Http> {
840
838
. await
841
839
}
842
840
841
+ /// EXPERIMENTAL
843
842
/// Get [embedders](https://www.meilisearch.com/docs/learn/experimental/vector_search) of the [Index].
844
843
///
845
844
/// ```
@@ -868,7 +867,6 @@ impl<Http: HttpClient> Index<Http> {
868
867
/// # index.delete().await.unwrap().wait_for_completion(&client, None, None).await.unwrap();
869
868
/// # });
870
869
/// ```
871
- #[ cfg( feature = "experimental-vector-search" ) ]
872
870
pub async fn get_embedders ( & self ) -> Result < HashMap < String , Embedder > , Error > {
873
871
self . client
874
872
. http_client
@@ -1940,6 +1938,7 @@ impl<Http: HttpClient> Index<Http> {
1940
1938
. await
1941
1939
}
1942
1940
1941
+ /// EXPERIMENTAL
1943
1942
/// Reset [embedders](https://www.meilisearch.com/docs/learn/experimental/vector_search) of the [Index].
1944
1943
///
1945
1944
/// # Example
@@ -1959,7 +1958,6 @@ impl<Http: HttpClient> Index<Http> {
1959
1958
/// # index.delete().await.unwrap().wait_for_completion(&client, None, None).await.unwrap();
1960
1959
/// # });
1961
1960
/// ```
1962
- #[ cfg( feature = "experimental-vector-search" ) ]
1963
1961
pub async fn reset_embedders ( & self ) -> Result < TaskInfo , Error > {
1964
1962
self . client
1965
1963
. http_client
@@ -2008,7 +2006,6 @@ mod tests {
2008
2006
assert_eq ! ( faceting, res) ;
2009
2007
}
2010
2008
2011
- #[ cfg( feature = "experimental-vector-search" ) ]
2012
2009
#[ meilisearch_test]
2013
2010
async fn test_get_embeddings ( index : Index ) {
2014
2011
let res = index. get_embedders ( ) . await . unwrap ( ) ;
@@ -2042,7 +2039,6 @@ mod tests {
2042
2039
assert_eq ! ( faceting, res) ;
2043
2040
}
2044
2041
2045
- #[ cfg( feature = "experimental-vector-search" ) ]
2046
2042
#[ meilisearch_test]
2047
2043
async fn test_reset_embedders ( client : Client , index : Index ) {
2048
2044
let features = crate :: features:: ExperimentalFeatures :: new ( & client)
@@ -2235,7 +2231,6 @@ mod tests {
2235
2231
assert_eq ! ( expected, res) ;
2236
2232
}
2237
2233
2238
- #[ cfg( feature = "experimental-vector-search" ) ]
2239
2234
#[ meilisearch_test]
2240
2235
async fn test_set_embedding_settings ( client : Client , index : Index ) {
2241
2236
let features = crate :: features:: ExperimentalFeatures :: new ( & client)
0 commit comments