Skip to content

Commit

Permalink
track total hits as before. datacite/datacite#875
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Nov 10, 2019
1 parent e892327 commit 984c3c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def find_by_id(ids, options={})
from: (options.dig(:page, :number) - 1) * options.dig(:page, :size),
size: options.dig(:page, :size),
sort: [options[:sort]],
track_total_hits: true,
query: {
terms: {
symbol: ids.map(&:upcase)
Expand All @@ -86,6 +87,7 @@ def find_by_id_list(ids, options={})
from: options[:page].present? ? (options.dig(:page, :number) - 1) * options.dig(:page, :size) : 0,
size: options[:size] || 25,
sort: [options[:sort]],
track_total_hits: true,
query: {
terms: {
id: ids.split(",")
Expand Down Expand Up @@ -296,7 +298,8 @@ def query(query, options={})
sort: sort,
query: es_query,
collapse: unique,
aggregations: aggregations
aggregations: aggregations,
track_total_hits: true,
}.compact)
end

Expand Down

0 comments on commit 984c3c8

Please sign in to comment.