[][src]Trait stellr::SolrCloudMethods

pub trait SolrCloudMethods: SolrCoreMethods {
    pub fn select(&self, collection: &str) -> SolrResult<RequestBuilder> { ... }
pub fn update(&self, collection: &str) -> SolrResult<RequestBuilder> { ... } }

Add Solr Cloud specific helper methods to any defined SolrClients.

The stellr crate separates out the node access (eg. via DirectSolrClient or ZkSolrClient structs) from the querying of the solr instances (via the SolrCoreMethods and SolrCloudMethods traits). This trait can be used with both the Direct and Zk-mediated clients.

The SolrCloudMethods trait builds on the SolrCoreMethods trait to add SolrCloud specific methods, such as to query or update solrcloud collections.

use stellr::prelude::*;
use stellr::response_types::SolrSelectType;
use serde_json;

let solr_client = stellr::ZkSolrClient::new("localhost:9983", "/")?;
let solr_request = solr_client
    .select("films")
    .expect("HTTP request creation failed...")
    .rows(10)
    .q(r#"id:"/en/"*"#);

let solr_result =
    solr_request
    .call::<SolrSelectType<serde_json::Value>>()
    .await
    .expect("Failed to parse")
;

assert_eq!(1100, solr_result.response.numFound);

Most of it's methods are based off of the create_*_request methods from SolrCoreMethods.

Provided methods

pub fn select(&self, collection: &str) -> SolrResult<RequestBuilder>[src]

Create a requestBuilder for a solrCloud select request

This method assumes the use of a GET method, and does not support POST currently.

pub fn update(&self, collection: &str) -> SolrResult<RequestBuilder>[src]

Create a requestBuilder for a solrCloud update request (using HTTP POST)

Loading content...

Implementors

impl SolrCloudMethods for DirectSolrClient[src]

Support the SolrCloud methods for a direct connection too

impl SolrCloudMethods for ZkSolrClient[src]

Loading content...