We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I turned off calls during testing and got this error.
Description Set active false, then run any search. It will cause this error.
Expected behavior
MeiliSearch::Rails.configuration = { ... active: !Rails.env.test? } class Document # meilisearch here end Document.search "something" # returns empty array
Current behavior Throws type error
TypeError: no implicit conversion of MeiliSearch::Rails::NullObject into Integer From: /home/bendangelo/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/kaminari-core-1.2.2/lib/kaminari/models/array_extension.rb:26 Kaminari::PaginatableArray#initialize: 18: def initialize(original_array = [], limit: nil, offset: nil, total_count: nil, padding: nil) 19: @_original_array, @_limit_value, @_offset_value, @_total_count, @_padding = original_array, (limit || default_per_page).to_i, offset.to_i, total_count, padding.to_i 20: 21: if limit && offset 22: extend Kaminari::PageScopeMethods 23: end 24: 25: if @_total_count && (@_total_count <= original_array.count) => 26: original_array = original_array.first(@_total_count)[@_offset_value, @_limit_value] 27: end
Screenshots or Logs #0 [method] first <Array#first(n=?)> => #1 [method] initialize <Kaminari::PaginatableArray#initialize(original_array=?, ?, ?, ?, ?)> #2 [method] initialize <MeiliSearch::Rails::Pagination::Kaminari#initialize(array, options)> #3 [method] create <MeiliSearch::Rails::Pagination::Kaminari.create(results, total_hits, options=?)> #4 [method] load_pagination! <MeiliSearch::Rails::Pagination.load_pagination!(pagination_backend, results, total_hits, options)> #5 [method] create <MeiliSearch::Rails::Pagination.create(results, total_hits, options=?)> #6 [method] ms_search <MeiliSearch::Rails::ClassMethods#ms_search(query, params=?)>
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered:
Edit: Looks like this is hit when a query returns no results?
This is my config:
MeiliSearch::Rails.configuration = { meilisearch_url: Rails.application.credentials.meilisearch_url, meilisearch_api_key: Rails.application.credentials.meilisearch_api_key, per_environment: true, pagination_backend: :kaminari, timeout: 2, max_retries: 1, active: !Rails.env.test? }
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
I turned off calls during testing and got this error.
Description
Set active false, then run any search. It will cause this error.
Expected behavior
Current behavior
Throws type error
Screenshots or Logs
#0 [method] first <Array#first(n=?)>
=> #1 [method] initialize <Kaminari::PaginatableArray#initialize(original_array=?, ?, ?, ?, ?)>
#2 [method] initialize <MeiliSearch::Rails::Pagination::Kaminari#initialize(array, options)>
#3 [method] create <MeiliSearch::Rails::Pagination::Kaminari.create(results, total_hits, options=?)>
#4 [method] load_pagination! <MeiliSearch::Rails::Pagination.load_pagination!(pagination_backend, results, total_hits, options)>
#5 [method] create <MeiliSearch::Rails::Pagination.create(results, total_hits, options=?)>
#6 [method] ms_search <MeiliSearch::Rails::ClassMethods#ms_search(query, params=?)>
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: