Crates.io | solrust |
lib.rs | solrust |
version | 0.1.10 |
source | src |
created_at | 2023-02-12 02:37:58.40239 |
updated_at | 2023-04-09 08:12:32.523411 |
description | Solr Client for Rust |
homepage | |
repository | https://github.com/fjnkt98/solrust |
max_upload_size | |
id | 782809 |
size | 126,908 |
Solr Client for Rust.
use serde_json::Value;
use solrust::client::solr::SolrClient;
use solrust::querybuilder::{
common::SolrCommonQueryBuilder,
q::QueryOperand,
sort::SortOrderBuilder,
standard::{SolrStandardQueryBuilder, StandardQueryBuilder},
};
use solrust::types::response::*;
#[tokio::main]
async fn main() {
let solr = SolrClient::new("http://localhost", 8983).unwrap();
let core = solr.core("example").await.unwrap();
let q = QueryOperand("id:foo".to_string());
let sort = SortOrderBuilder::new().desc("score").asc("id");
let builder = StandardQueryBuilder::new().q(&q).sort(&sort);
let response: SolrSelectResponse<Value> = core.select(&builder.build()).await.unwrap();
println!("{:?}", response);
}