Coder Social home page Coder Social logo

Comments (6)

karmi avatar karmi commented on June 22, 2024

That's quite weird, see the integration test at https://github.com/elasticsearch/elasticsearch-rails/blob/master/elasticsearch-model/test/integration/active_record_pagination_test.rb#L42

Are you loading Kaminari before the elasticsearch-model gem or configuring it?

from elasticsearch-rails.

lfv89 avatar lfv89 commented on June 22, 2024

Hi Karmi, thanks for your response.

Yes, actually I'm both loading kaminari before the elasticsearch-model gem and also configuring it as you said in a related issue (sorry, forget the issue number). I'm gonna take a look at this integration test in a few hours than I reply here. And before I forget, I'm not using Activerecord, I'm using Mongoid!

from elasticsearch-rails.

lfv89 avatar lfv89 commented on June 22, 2024

@karmi I just found the error. In a given context my search definition had a size: {}. So, the method limit_value from elasticsearch-model/lib/elasticsearch/model/response/pagination.rb was returning an empty hash, which broke the kaminari calculations. I thought of sending a PR to ensure that limit_value method will always return a number, but then I thought that the error was only my fault, so I changed my mind. What do you think?

from elasticsearch-rails.

karmi avatar karmi commented on June 22, 2024

Yeah, I think think people should just pass a number to size, I wouldn't hand-hold them :)

from elasticsearch-rails.

benben avatar benben commented on June 22, 2024

btw this is also working for me with the patch from #42

from elasticsearch-rails.

lfv89 avatar lfv89 commented on June 22, 2024

Good to know @benben. It was my mistake, I'm closing this issue!

from elasticsearch-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.