#client #solr #standard #macro #query-builder #sorting #solrust

solrust_derive_internals

Implementations of derive macro for solrust

8 releases

0.1.7 Apr 2, 2023
0.1.6 Mar 26, 2023
0.1.0 Feb 12, 2023

#1427 in Procedural macros

42 downloads per month
Used in 2 crates

Apache-2.0

12KB
263 lines

solrust

Solr Client for Rust.

Basic Usage

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);
}

Future Works

Dependencies

~1.5MB
~35K SLoC