opensearch_client/common/
explain_response.rs1use crate::core;
12use crate::common;
13use serde::{Deserialize, Serialize};
14
15
16
17
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19pub struct ExplainResponse {
20 #[serde(rename = "explanation", default, skip_serializing_if = "Option::is_none")]
21 pub explanation: Option<core::explain::ExplanationDetail>,
22 #[serde(rename = "_index")]
23 pub index: String,
24 #[serde(rename = "matched")]
25 pub matched: bool,
26 #[serde(rename = "get", default, skip_serializing_if = "Option::is_none")]
27 pub get: Option<common::InlineGet>,
28 #[serde(rename = "_id")]
29 pub id: String,
30}
31
32impl ExplainResponse {
33
34 pub fn new(index: String, matched: bool, id: String) -> ExplainResponse {
35 ExplainResponse {
36 explanation: None,
37 index,
38 matched,
39 get: None,
40 id,
41 }
42 }
43}