Auto saved by Logseq

This commit is contained in:
Matthias Eckert 2023-01-25 13:59:32 +01:00
parent e82da57523
commit 644d829394

View File

@ -1,7 +1,9 @@
- JQ Solr Facets Group #JQ #Solr - JQ Solr Facets/Pivot Group #JQ #Solr
- Group the facet with .key: .value - 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)]} ]}``
- Group the facet with .key: .value and sort it by value asc - 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`` - ``.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``
- Group the facet with .key: .value and sort it by value asc as TSV - Group the facet with .key: .value and sort it by value asc as TSV
- ``.facet_counts.facet_fields | {"sources": [.sourceUrl as $m | range(0; $m | length; 2) | {($m[.]): $m[(. + 1)]} ]} | [.sources[] | to_entries | add] | sort_by(.value) | reverse[] | [.key, .value] | @csv`` - ``.facet_counts.facet_fields | {"sources": [.sourceUrl as $m | range(0; $m | length; 2) | {($m[.]): $m[(. + 1)]} ]} | [.sources[] | to_entries | add] | sort_by(.value) | reverse[] | [.key, .value] | @csv``
- Unwrap pivot for csv
- ``.facet_counts.facet_pivot. "sourceType,sourceUrl" | map(. as $st | $st.pivot | map({"sourceType": $st.value, "url":.value, "count": .count})) | add | sort_by(.count) | reverse[] | [.sourceType, .url, .count] | @csv``