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
Document{id:0,kind:"text".into(),number:0,value:S("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),nested:Nested{child:S("first")}},
874
-
Document{id:1,kind:"text".into(),number:10,value:S("dolor sit amet, consectetur adipiscing elit"),nested:Nested{child:S("second")}},
875
-
Document{id:2,kind:"title".into(),number:20,value:S("The Social Network"),nested:Nested{child:S("third")}},
876
-
Document{id:3,kind:"title".into(),number:30,value:S("Harry Potter and the Sorcerer's Stone"),nested:Nested{child:S("fourth")}},
877
-
Document{id:4,kind:"title".into(),number:40,value:S("Harry Potter and the Chamber of Secrets"),nested:Nested{child:S("fift")}},
878
-
Document{id:5,kind:"title".into(),number:50,value:S("Harry Potter and the Prisoner of Azkaban"),nested:Nested{child:S("sixth")}},
879
-
Document{id:6,kind:"title".into(),number:60,value:S("Harry Potter and the Goblet of Fire"),nested:Nested{child:S("seventh")}},
880
-
Document{id:7,kind:"title".into(),number:70,value:S("Harry Potter and the Order of the Phoenix"),nested:Nested{child:S("eighth")}},
881
-
Document{id:8,kind:"title".into(),number:80,value:S("Harry Potter and the Half-Blood Prince"),nested:Nested{child:S("ninth")}},
882
-
Document{id:9,kind:"title".into(),number:90,value:S("Harry Potter and the Deathly Hallows"),nested:Nested{child:S("tenth")}},
971
+
Document{id:0,kind:"text".into(),number:0,value:S("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),nested:Nested{child:S("first")},_vectors:Some(Vectors::from(&[1000.0]))},
972
+
Document{id:1,kind:"text".into(),number:10,value:S("dolor sit amet, consectetur adipiscing elit"),nested:Nested{child:S("second")},_vectors:Some(Vectors::from(&[2000.0]))},
973
+
Document{id:2,kind:"title".into(),number:20,value:S("The Social Network"),nested:Nested{child:S("third")},_vectors:Some(Vectors::from(&[3000.0]))},
974
+
Document{id:3,kind:"title".into(),number:30,value:S("Harry Potter and the Sorcerer's Stone"),nested:Nested{child:S("fourth")},_vectors:Some(Vectors::from(&[4000.0]))},
975
+
Document{id:4,kind:"title".into(),number:40,value:S("Harry Potter and the Chamber of Secrets"),nested:Nested{child:S("fift")},_vectors:Some(Vectors::from(&[5000.0]))},
976
+
Document{id:5,kind:"title".into(),number:50,value:S("Harry Potter and the Prisoner of Azkaban"),nested:Nested{child:S("sixth")},_vectors:Some(Vectors::from(&[6000.0]))},
977
+
Document{id:6,kind:"title".into(),number:60,value:S("Harry Potter and the Goblet of Fire"),nested:Nested{child:S("seventh")},_vectors:Some(Vectors::from(&[7000.0]))},
978
+
Document{id:7,kind:"title".into(),number:70,value:S("Harry Potter and the Order of the Phoenix"),nested:Nested{child:S("eighth")},_vectors:Some(Vectors::from(&[8000.0]))},
979
+
Document{id:8,kind:"title".into(),number:80,value:S("Harry Potter and the Half-Blood Prince"),nested:Nested{child:S("ninth")},_vectors:Some(Vectors::from(&[9000.0]))},
980
+
Document{id:9,kind:"title".into(),number:90,value:S("Harry Potter and the Deathly Hallows"),nested:Nested{child:S("tenth")},_vectors:Some(Vectors::from(&[10000.0]))},
value:S("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
// this is mocked as I could not get the hybrid searching to work
1696
+
// See https://github.com/meilisearch/meilisearch-rust/pull/554 for further context
1697
+
letmut s = mockito::Server::new_async().await;
1698
+
let mock_server_url = s.url();
1699
+
let client = Client::new(mock_server_url,None::<String>)?;
1700
+
let index = client.index("mocked_index");
1701
+
1702
+
let req = r#"{"q":"hello hybrid searching","hybrid":{"embedder":"default","semanticRatio":0.0},"vector":[1000.0]}"#.to_string();
1703
+
let response = r#"{"hits":[],"offset":null,"limit":null,"estimatedTotalHits":null,"page":null,"hitsPerPage":null,"totalHits":null,"totalPages":null,"facetDistribution":null,"facetStats":null,"processingTimeMs":0,"query":"","indexUid":null}"#.to_string();
1704
+
let mock_res = s
1705
+
.mock("POST","/indexes/mocked_index/search")
1706
+
.with_status(200)
1707
+
.match_body(mockito::Matcher::Exact(req))
1708
+
.with_body(&response)
1709
+
.expect(1)
1710
+
.create_async()
1711
+
.await;
1712
+
let results:Result<SearchResults<Document>,Error> = index
1713
+
.search()
1714
+
.with_query("hello hybrid searching")
1715
+
.with_hybrid("default",0.0)
1716
+
.with_vector(&[1000.0])
1717
+
.execute()
1718
+
.await;
1719
+
mock_res.assert_async().await;
1720
+
results?;// purposely not done above to have better debugging output
0 commit comments