From c95455141677962debbc4314d545726f9f116a59 Mon Sep 17 00:00:00 2001 From: Matthias Eckert Date: Wed, 25 Jan 2023 12:03:31 +0100 Subject: [PATCH] Auto saved by Logseq --- journals/2023_01_25.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/journals/2023_01_25.md b/journals/2023_01_25.md index eb17ee4b..b8dde323 100644 --- a/journals/2023_01_25.md +++ b/journals/2023_01_25.md @@ -1,5 +1,5 @@ - JQ Solr Facets Group #JQ #Solr - Group the facet with .key: .value - ``.facet_counts.facet_fields | {"sources": [.sourceUrl as $m | range(0; $m | length; 2) | {($m[.]): $m[(. + 1)]} ]}`` - - - - ``.facet_counts.facet_fields | {"sources": [.sourceUrl as $m | range(0; $m | length; 2) | {($m[.]): $m[(. + 1)]} ]} | [.sources[] | to_entries | add] | sort_by(.value) | reverse | from_entries`` \ No newline at end of file + - Group the facet with .key: .value and sort it by value asc + - ``.facet_counts.facet_fields | {"sources": [.sourceUrl as $m | range(0; $m | length; 2) | {($m[.]): $m[(. + 1)]} ]} | [.sources[] | to_entries | add] | sort_by(.value) | reverse | from_entries`` \ No newline at end of file