You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/indexes.rs
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ impl<'a> Index<'a> {
111
111
/// let mut movies = client.get_or_create("movies").await.unwrap();
112
112
///
113
113
/// // add some documents
114
-
/// # movies.add_or_replace(&vec![Movie{name:String::from("Interstellar"), description:String::from("Interstellar chronicles the adventures of a group of explorers who make use of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances involved in an interstellar voyage.")},Movie{name:String::from("Unknown"), description:String::from("Unknown")}], Some("name")).await.unwrap();
114
+
/// # movies.add_or_replace(&[Movie{name:String::from("Interstellar"), description:String::from("Interstellar chronicles the adventures of a group of explorers who make use of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances involved in an interstellar voyage.")},Movie{name:String::from("Unknown"), description:String::from("Unknown")}], Some("name")).await.unwrap();
/// let query = Query::new("Interstellar").with_limit(5);
@@ -167,7 +167,7 @@ impl<'a> Index<'a> {
167
167
/// # client.create_index("movies", None).await;
168
168
/// let movies = client.get_index("movies").await.unwrap();
169
169
/// # let mut movies = client.get_index("movies").await.unwrap();
170
-
/// # movies.add_or_replace(&vec![Movie{name:String::from("Interstellar"), description:String::from("Interstellar chronicles the adventures of a group of explorers who make use of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances involved in an interstellar voyage.")}], Some("name")).await.unwrap();
170
+
/// # movies.add_or_replace(&[Movie{name:String::from("Interstellar"), description:String::from("Interstellar chronicles the adventures of a group of explorers who make use of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances involved in an interstellar voyage.")}], Some("name")).await.unwrap();
/// // retrieve a document (you have to put the document in the index before)
@@ -227,7 +227,7 @@ impl<'a> Index<'a> {
227
227
/// let movie_index = client.get_index("movies").await.unwrap();
228
228
/// # let mut movie_index = client.get_index("movies").await.unwrap();
229
229
///
230
-
/// # movie_index.add_or_replace(&vec![Movie{name:String::from("Interstellar"), description:String::from("Interstellar chronicles the adventures of a group of explorers who make use of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances involved in an interstellar voyage.")}], Some("name")).await.unwrap();
230
+
/// # movie_index.add_or_replace(&[Movie{name:String::from("Interstellar"), description:String::from("Interstellar chronicles the adventures of a group of explorers who make use of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances involved in an interstellar voyage.")}], Some("name")).await.unwrap();
/// // retrieve movies (you have to put some movies in the index before)
@@ -300,7 +300,7 @@ impl<'a> Index<'a> {
300
300
/// let client = Client::new("http://localhost:7700", "");
301
301
/// let mut movie_index = client.get_or_create("movies").await.unwrap();
302
302
///
303
-
/// movie_index.add_or_replace(&vec.
350
350
pubasyncfnadd_documents<T:Document>(
351
351
&'aself,
352
-
documents:&Vec<T>,
352
+
documents:&[T],
353
353
primary_key:Option<&str>,
354
354
) -> Result<Progress<'a>,Error>{
355
355
self.add_or_replace(documents, primary_key).await
@@ -388,7 +388,7 @@ impl<'a> Index<'a> {
388
388
/// let client = Client::new("http://localhost:7700", "");
389
389
/// let mut movie_index = client.get_or_create("movies").await.unwrap();
390
390
///
391
-
/// movie_index.add_or_update(&vec![
391
+
/// movie_index.add_or_update(&[
392
392
/// Movie{
393
393
/// name: String::from("Interstellar"),
394
394
/// description: String::from("Interstellar chronicles the adventures of a group of explorers who make use of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances involved in an interstellar voyage.")
/// let client = Client::new("http://localhost:7700", "");
503
503
/// let mut movies = client.get_or_create("movies").await.unwrap();
504
504
///
505
-
/// # movies.add_or_replace(&vec![Movie{name:String::from("Interstellar"), description:String::from("Interstellar chronicles the adventures of a group of explorers who make use of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances involved in an interstellar voyage.")}], Some("name")).await.unwrap();
505
+
/// # movies.add_or_replace(&[Movie{name:String::from("Interstellar"), description:String::from("Interstellar chronicles the adventures of a group of explorers who make use of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances involved in an interstellar voyage.")}], Some("name")).await.unwrap();
/// let mut movies = client.get_or_create("movies").await.unwrap();
552
552
///
553
553
/// // add some documents
554
-
/// # movies.add_or_replace(&vec![Movie{name:String::from("Interstellar"), description:String::from("Interstellar chronicles the adventures of a group of explorers who make use of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances involved in an interstellar voyage.")},Movie{name:String::from("Unknown"), description:String::from("Unknown")}], Some("name")).await.unwrap();
554
+
/// # movies.add_or_replace(&[Movie{name:String::from("Interstellar"), description:String::from("Interstellar chronicles the adventures of a group of explorers who make use of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances involved in an interstellar voyage.")},Movie{name:String::from("Unknown"), description:String::from("Unknown")}], Some("name")).await.unwrap();
0 commit comments