manticoresearch 2.0.0

Сlient for Manticore Search.
Documentation
/*
 * Manticore Search Client
 *
 * Сlient for Manticore Search. 
 *
 * The version of the OpenAPI document: 5.0.0
 * Contact: info@manticoresearch.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// GeoDistance : Object to perform geo-distance based filtering on queries
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GeoDistance {
    #[serde(rename = "location_anchor", skip_serializing_if = "Option::is_none")]
    pub location_anchor: Option<Box<models::GeoDistanceLocationAnchor>>,
    /// Field name in the document that contains location data
    #[serde(rename = "location_source", skip_serializing_if = "Option::is_none")]
    pub location_source: Option<String>,
    /// Algorithm used to calculate the distance
    #[serde(rename = "distance_type", skip_serializing_if = "Option::is_none")]
    pub distance_type: Option<DistanceType>,
    /// The distance from the anchor point to filter results by
    #[serde(rename = "distance", skip_serializing_if = "Option::is_none")]
    pub distance: Option<String>,
}

impl GeoDistance {
    /// Object to perform geo-distance based filtering on queries
    pub fn new() -> GeoDistance {
        GeoDistance {
            location_anchor: None,
            location_source: None,
            distance_type: None,
            distance: None,
        }
    }
}
/// Algorithm used to calculate the distance
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DistanceType {
    #[serde(rename = "adaptive")]
    Adaptive,
    #[serde(rename = "haversine")]
    Haversine,
}

impl Default for DistanceType {
    fn default() -> DistanceType {
        Self::Adaptive
    }
}