Guest User

Untitled

a guest
May 27th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #[test]
  2. fn test_basic() {
  3. let dbname = "target/tests/basic";
  4. let _ = Index::drop(dbname);
  5. let mut batch = Batch::new();
  6.  
  7. let mut index = Index::open(dbname, Some(OpenOptions::Create)).unwrap();
  8.  
  9. let id1 = index.add(r#"{"State":"TX","City":"Dallas"}"#, &mut batch).unwrap();
  10. let id2 = index.add(r#"{"State":"TX","City":"Austin"}"#, &mut batch).unwrap();
  11. let id3 = index.add(r#"{"State":"NY","City":"New York"}"#, &mut batch).unwrap();
  12.  
  13. index.flush(batch).unwrap();
  14.  
  15. let mut results = index.query(r#"find order State, City"#, None).unwrap();
  16. }
Add Comment
Please, Sign In to add comment