Git Product home page Git Product logo

Comments (8)

kidpollo avatar kidpollo commented on September 26, 2024

I just merged some changes from a pull request done by @adrnai which do some changes to the instatiation logic can you please test your code by using the code from master

gem 'tanker', :git => 'git://github.com/kidpollo/tanker.git'

from tanker.

kidpollo avatar kidpollo commented on September 26, 2024

It seems I am unable to reproduce this behavior. One good way to debug is looking fo this line

results = index.search(query, options)

In tanker.rb and throwing a debugger in there.

please reffer to this issue

#50

from tanker.

marcusg avatar marcusg commented on September 26, 2024

Now, after getting the pagination to work i run into the same problem with pagination and scopes! Here is what i did:

# it's working without scopes
t = Tour.search_tank "spanien"
t.count
>> 9
t.count
>> 9

# but not with!
t = Tour.reduce_to_coming_scope.search_tank "spanien"
t.count 
>> 2 # this is correct
t.total_entries
>> 9 # this is the wrong, there are only 2

so i think total_entries is not counting correct, any ideas?

from tanker.

kidpollo avatar kidpollo commented on September 26, 2024

Hey @marcusg

Using scopes on tanker is a strange feature I added from someone in the community because it leads to all sorts of confusion.

Named scopes in Rails are no more that filters. A search index does not filter the same way a RBMS filters so what you are getting is accurate. The total entries does match what index tanx matches but out of those 9 entries only 2 match your scope.

I would not like to remove that feature cause it might be useful for other people.

from tanker.

marcusg avatar marcusg commented on September 26, 2024

hey @kidpollo

okay, so there is no change or an update planned? Then I have to find a way to use like I want :) Thanks for your help man!

from tanker.

kidpollo avatar kidpollo commented on September 26, 2024

I would love to see your input in this issue actually :D

The only update for me would be to put a warning in the readme to be careful of using scopes and Index Tank at the same time.

If you can find some kind of logic that would make scopes affect the search query in a way that makes sense go for it :P

I would personaly use some kind of fuzzy pagination :P

from tanker.

marcusg avatar marcusg commented on September 26, 2024

Of course, I'll send a pull request when i found a way to implement this in tanker ;)

from tanker.

shyamster avatar shyamster commented on September 26, 2024

Sorry I disappeared after posting this. I went on a backpacking trip and had no access to work stuff! I will play with the latest and see if I can help later today.

from tanker.

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.