pub async fn random(self, limit: i64) -> Result<serde_json::Value, Box<dyn std::error::Error>> {
        let out: serde_json::Value = reqwest::Client::new()
            .get(&self.getendpoint())
            .json(&serde_json::json!({ "size":limit,"query": { "function_score": { "functions": [ { "random_score":  {} } ],  "score_mode": "sum",} }}))
            .send()
            .await?
            .json()
            .await?;
        Ok(out)
    }
/// call elasticsearch's random function
call elasticsearch's random function
call elasticsearch ' s random function
pub async fn random(self, limit: i64) -> Result<serde_json::Value, Box<dyn std::error::Error>> {
        let out: serde_json::Value = reqwest::Client::new()
            .get(&self.getendpoint())
            .json(&serde_json::json!({ "size":limit,"query": { "function_score": { "functions": [ { "random_score":  {} } ],  "score_mode": "sum",} }}))
            .send()
            .await?
            .json()
            .await?;
        Ok(out)
    }
pub async fn random ( self , limit : i64 ) -> Result < serde_json :: Value , Box < dyn std :: error :: Error > > { let out : serde_json :: Value = reqwest :: Client :: new ( ) . get ( & self . getendpoint ( ) ) . json ( & serde_json :: json ! ( { " " limit " " { " " { " " [ { " " { } } ] " " " " } } } ) ) . send ( ) . await ? . json ( ) . await ? ; Ok ( out ) }
call elasticsearch's random function
call elasticsearch ' s random function
self
limit
i64
self
limit
i64