Skip to content

Commit

Permalink
remove source in es params, remove fields in response
Browse files Browse the repository at this point in the history
  • Loading branch information
PSeitz committed Feb 15, 2024
1 parent 002b6f5 commit 0bd03ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ pub struct SearchQueryParams {
#[serde(default)]
pub sort: Option<Vec<String>>,
#[serde(default)]
pub source: Option<String>,
#[serde(serialize_with = "to_simple_list")]
#[serde(deserialize_with = "from_simple_list")]
#[serde(default)]
pub stats: Option<Vec<String>>,
#[serde(serialize_with = "to_simple_list")]
#[serde(deserialize_with = "from_simple_list")]
Expand Down
11 changes: 2 additions & 9 deletions quickwit/quickwit-serve/src/elasticsearch_api/rest_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use std::collections::{BTreeMap, HashMap};
use std::collections::HashMap;
use std::str::from_utf8;
use std::sync::Arc;
use std::time::{Duration, Instant};
Expand Down Expand Up @@ -587,13 +587,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<String, serde_json::Value> = 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 {
Expand All @@ -610,7 +603,7 @@ fn convert_hit(
}

ElasticHit {
fields,
fields: Default::default(),
explanation: None,
index: hit.index_id,
id: "".to_string(),
Expand Down

0 comments on commit 0bd03ac

Please sign in to comment.