Skip to content

Commit

Permalink
fix(search,afterfact): fixed allfieldinfo in json output of search co…
Browse files Browse the repository at this point in the history
…mmand #1251
  • Loading branch information
hitenkoku committed Feb 10, 2024
1 parent 380376f commit 27278ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/afterfact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1637,8 +1637,8 @@ pub fn output_json_str(
let mut children_output_order = vec![];
for contents in details_target_stock.iter() {
let (key, value) = contents.split_once(':').unwrap_or_default();
let output_key = _convert_valid_json_str(&[key], false);
let fmted_val = _convert_valid_json_str(&[value.trim_start()], false);
let output_key = _convert_valid_json_str(&[key.trim()], false);
let fmted_val = _convert_valid_json_str(&[value.trim()], false);
if let RawEntryMut::Vacant(_) = children_output_stock
.raw_entry_mut()
.from_key(output_key.as_str())
Expand Down
10 changes: 9 additions & 1 deletion src/timeline/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,14 @@ pub fn search_result_dsp_msg(
file_wtr.as_mut().unwrap().write_record(&record_data).ok();
} else if output.is_some() && (json_output || jsonl_output) {
file_wtr.as_mut().unwrap().write_field("{").ok();
let mut detail_infos: HashMap<CompactString, Vec<CompactString>> = HashMap::default();
detail_infos.insert(
CompactString::from("#AllFieldInfo"),
all_field_info
.split('¦')
.map(CompactString::from)
.collect_vec(),
);
let (output_json_str_ret, _) = output_json_str(
&vec![
(
Expand Down Expand Up @@ -481,7 +489,7 @@ pub fn search_result_dsp_msg(
false,
false,
false,
&[&HashMap::default(), &HashMap::default()],
&[&detail_infos, &HashMap::default()],
);

file_wtr
Expand Down

0 comments on commit 27278ec

Please sign in to comment.