3 unstable releases
Uses old Rust 2015
0.1.0 | Jun 17, 2015 |
---|---|
0.0.3 | Dec 11, 2014 |
0.0.2 | Dec 7, 2014 |
#8 in #solr
39KB
715 lines
Heliotrope
SOLR client for Rust programming language
[dependencies]
heliotrope = "*"
Documentation
TODO
- facets
- deleting docs
- highlighting
- etc
Try it!
git clone https://github.com/Valve/heliotrope
cd heliotrope
cargo run --example hello
Usage
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 = Solr::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);
}
}
Licence
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.
Dependencies
~6–13MB
~144K SLoC