[dependencies]
heliotrope = "*"
- facets
- deleting docs
- highlighting
- etc
git clone https://github.com/Valve/heliotrope
cd heliotrope
cargo run --example hello
Add dependency to your project by Cargo.toml
[dependencies]
heliotrope = "*"
extern crate heliotrope;
extern crate url;
use heliotrope::{Solr, SolrDocument, SolrQuery};
use url::Url;
fn main(){
let base_url = "http://localhost:8983/solr/test/";
let url: Url = Url::parse(base_url).unwrap();
let client = SolrClient::new(&url);
let doc = SolrDocument::new();
doc.add_field("id", "1");
doc.add_field("city", "London");
client.add_and_commit(&doc);
let query_all = SolrQuery::new("*:*");
let results = client.query(&query_all);
if let Ok(resp) = results {
println!("Retreived results {:?}", resp);
}
}
Copyright 2015 Valentin Vasilyev, Dzmitry Misiuk
Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. This file may not be copied, modified, or distributed except according to those terms.