extern crate elastic;
extern crate env_logger;
#[macro_use]
extern crate serde_json;
use std::error::Error;
use serde_json::Value;
use elastic::prelude::*;
fn run() -> Result<(), Box<Error>> {
let client = SyncClientBuilder::new().build()?;
let res = client
.search::<Value>()
.index("_all")
.body(json!({
"query": {
"query_string": {
"query": "*"
}
}
}))
.send()?;
for hit in res.hits() {
println!("{:?}", hit);
}
println!("{:?}", res);
Ok(())
}
fn main() {
env_logger::init().unwrap();
run().unwrap();
}