Skip to content

Commit

Permalink
show all publication years in aggegation
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 18, 2020
1 parent 741493e commit 48a319c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ GEM
latex-decode (~> 0.0)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
bolognese (1.5.16)
bolognese (1.5.17)
activesupport (>= 4.2.5)
benchmark_methods (~> 0.7)
bibtex-ruby (>= 5.1.0)
Expand Down
31 changes: 29 additions & 2 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,35 @@ def self.query_aggregations
{
resource_types: { terms: { field: 'resource_type_id_and_name', size: 16, min_doc_count: 1 } },
states: { terms: { field: 'aasm_state', size: 3, min_doc_count: 1 } },
years: { date_histogram: { field: 'publication_year', interval: 'year', format: 'year', order: { _key: "desc" }, min_doc_count: 1 },
aggs: { bucket_truncate: { bucket_sort: { size: 10 } } } },
years: {
# filter: {
# range: {
# "publication_year": {
# "gte": "2000"
# }
# }
# },
# aggs: {
# published: {
date_histogram: {
field: 'publication_year',
interval: 'year',
format: 'year',
order: {
_key: "desc"
},
min_doc_count: 1
},
# aggs: {
# bucket_truncate: {
# bucket_sort: {
# size: 10
# }
# }
# }
# }
# }
},
registration_agencies: { terms: { field: 'agency', size: 10, min_doc_count: 1 } },
created: { date_histogram: { field: 'created', interval: 'year', format: 'year', order: { _key: "desc" }, min_doc_count: 1 },
aggs: { bucket_truncate: { bucket_sort: { size: 10 } } } },
Expand Down

0 comments on commit 48a319c

Please sign in to comment.