diff --git a/quickwit/quickwit-serve/src/elasticsearch_api/model/search_query_params.rs b/quickwit/quickwit-serve/src/elasticsearch_api/model/search_query_params.rs index 8dbada5d23e..efe0d0a56c2 100644 --- a/quickwit/quickwit-serve/src/elasticsearch_api/model/search_query_params.rs +++ b/quickwit/quickwit-serve/src/elasticsearch_api/model/search_query_params.rs @@ -128,10 +128,6 @@ pub struct SearchQueryParams { #[serde(default)] pub sort: Option>, #[serde(default)] - pub source: Option, - #[serde(serialize_with = "to_simple_list")] - #[serde(deserialize_with = "from_simple_list")] - #[serde(default)] pub stats: Option>, #[serde(serialize_with = "to_simple_list")] #[serde(deserialize_with = "from_simple_list")] diff --git a/quickwit/quickwit-serve/src/elasticsearch_api/rest_handler.rs b/quickwit/quickwit-serve/src/elasticsearch_api/rest_handler.rs index 60e9acae877..ed9baf5050b 100644 --- a/quickwit/quickwit-serve/src/elasticsearch_api/rest_handler.rs +++ b/quickwit/quickwit-serve/src/elasticsearch_api/rest_handler.rs @@ -17,7 +17,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use std::collections::{BTreeMap, HashMap}; +use std::collections::HashMap; use std::str::from_utf8; use std::sync::Arc; use std::time::{Duration, Instant}; @@ -609,13 +609,6 @@ fn convert_hit( Source::from_string(serde_json::to_string(&json).unwrap_or_else(|_| "{}".to_string())) .unwrap_or_else(|_| Source::from_string("{}".to_string()).unwrap()); - let mut fields: BTreeMap = Default::default(); - if let serde_json::Value::Object(map) = json { - for (key, val) in map { - fields.insert(key, val); - } - } - let mut sort = Vec::new(); if let Some(partial_hit) = hit.partial_hit { if let Some(sort_value) = partial_hit.sort_value { @@ -632,7 +625,7 @@ fn convert_hit( } ElasticHit { - fields, + fields: Default::default(), explanation: None, index: hit.index_id, id: "".to_string(), diff --git a/quickwit/rest-api-tests/scenarii/sort_orders/0001-sort-elasticapi.yaml b/quickwit/rest-api-tests/scenarii/sort_orders/0001-sort-elasticapi.yaml index 7684c075164..cdf7de1297c 100644 --- a/quickwit/rest-api-tests/scenarii/sort_orders/0001-sort-elasticapi.yaml +++ b/quickwit/rest-api-tests/scenarii/sort_orders/0001-sort-elasticapi.yaml @@ -13,13 +13,13 @@ expected: value: 7 relation: "eq" hits: - - fields: { "count": 15, "id": 2 } - - fields: { "count": 10, "id": 0 } - - fields: { "count": 10, "id": 2 } - - fields: { "count": 10, "id": 1 } - - fields: {"count": -2.5, "id": 4} - - fields: { "id": 5 } - - fields: { "id": 3 } + - _source: { "count": 15, "id": 2 } + - _source: { "count": 10, "id": 0 } + - _source: { "count": 10, "id": 2 } + - _source: { "count": 10, "id": 1 } + - _source: {"count": -2.5, "id": 4} + - _source: { "id": 5 } + - _source: { "id": 3 } --- endpoint: _elastic/sortorder/_search json: @@ -33,13 +33,13 @@ expected: value: 7 relation: "eq" hits: - - fields: {"count": -2.5, "id": 4} - - fields: {"count": 10, "id": 1 } - - fields: {"count": 10, "id": 2 } - - fields: {"count": 10, "id": 0 } - - fields: {"count": 15, "id": 2 } - - fields: {"id": 3} - - fields: {"id": 5} + - _source: {"count": -2.5, "id": 4} + - _source: {"count": 10, "id": 1 } + - _source: {"count": 10, "id": 2 } + - _source: {"count": 10, "id": 0 } + - _source: {"count": 15, "id": 2 } + - _source: {"id": 3} + - _source: {"id": 5} --- endpoint: _elastic/sortorder/_search json: @@ -54,13 +54,13 @@ expected: value: 7 relation: "eq" hits: - - fields: {"count": 10, "id": 0 } - - fields: {"count": 10, "id": 1 } - - fields: {"count": 10, "id": 2 } - - fields: {"count": 15, "id": 2 } - - fields: {"id": 3} - - fields: {"count": -2.5, "id": 4} - - fields: {"id": 5} + - _source: {"count": 10, "id": 0 } + - _source: {"count": 10, "id": 1 } + - _source: {"count": 10, "id": 2 } + - _source: {"count": 15, "id": 2 } + - _source: {"id": 3} + - _source: {"count": -2.5, "id": 4} + - _source: {"id": 5} --- endpoint: _elastic/sortorder/_search json: @@ -75,10 +75,10 @@ expected: value: 7 relation: "eq" hits: - - fields: {"count": 15, "id": 2 } - - fields: {"count": 10, "id": 2 } - - fields: {"count": 10, "id": 1 } - - fields: {"count": 10, "id": 0 } - - fields: {"count": -2.5, "id": 4} - - fields: {"id": 5} - - fields: {"id": 3} + - _source: {"count": 15, "id": 2 } + - _source: {"count": 10, "id": 2 } + - _source: {"count": 10, "id": 1 } + - _source: {"count": 10, "id": 0 } + - _source: {"count": -2.5, "id": 4} + - _source: {"id": 5} + - _source: {"id": 3}