typesense-rs 27.0.1

An open source search engine for building delightful search experiences.
Documentation
// Typesense API
//
// An open source search engine for building delightful search experiences.
//
// The version of the OpenAPI document: 27.0
//
// Generated by: https://openapi-generator.tech

use serde::{Deserialize, Serialize};

use crate::models;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SearchHighlight {
	#[serde(rename = "field", skip_serializing_if = "Option::is_none")]
	pub field: Option<String>,
	/// The indices property will be present only for string[] fields and will
	/// contain the corresponding indices of the snippets in the search field
	#[serde(rename = "indices", skip_serializing_if = "Option::is_none")]
	pub indices: Option<Vec<i32>>,
	#[serde(rename = "matched_tokens", skip_serializing_if = "Option::is_none")]
	pub matched_tokens: Option<Vec<serde_json::Value>>,
	/// Present only for (non-array) string fields
	#[serde(rename = "snippet", skip_serializing_if = "Option::is_none")]
	pub snippet: Option<String>,
	/// Present only for (array) string[] fields
	#[serde(rename = "snippets", skip_serializing_if = "Option::is_none")]
	pub snippets: Option<Vec<String>>,
	/// Full field value with highlighting, present only for (non-array) string
	/// fields
	#[serde(rename = "value", skip_serializing_if = "Option::is_none")]
	pub value: Option<String>,
	/// Full field value with highlighting, present only for (array) string[]
	/// fields
	#[serde(rename = "values", skip_serializing_if = "Option::is_none")]
	pub values: Option<Vec<String>>,
}

impl SearchHighlight {
	pub fn new() -> SearchHighlight {
		SearchHighlight {
			field: None,
			indices: None,
			matched_tokens: None,
			snippet: None,
			snippets: None,
			value: None,
			values: None,
		}
	}
}