Git Product home page Git Product logo

Comments (2)

kidpollo avatar kidpollo commented on September 26, 2024

I think the problem is you are not indexing the id attribute.

My original reasoning that the user must decide to index or not the attributes he/she wants because for some people it might not make sense to fiter by id and for some not and I wanted to keep it minimal and extensive.

I am working on features where this might change in the future but you should not worry for now just make sure to index the id also, sorry if this is not clear I did not expect this was implied :D
Ej.

class Product
include Tanker

tankit 'tanker_integration_tests' do
indexes :id
indexes :name
indexes :href
indexes :tags
end

end

from tanker.

kidpollo avatar kidpollo commented on September 26, 2024

btw this can be achieved many ways, I am working on integration specs for better understanding of how thos works but here is a peek

...

 before(:all) do
    @doggie_1 = Product.create(:name => 'doggie 1', :tags => ['puppuy', 'pug'] )
    @doggie_2 = Product.create(:name => 'doggie 2', :tags => ['pug'] )
    @doggie_3 = Product.create(:name => 'doggie 3', :tags => ['puppuy', 'yoirkie'] )
  end

...

 it 'should not search for doggie_3' do
    @results = Product.search_tank('doggie', :conditions => {:tags => 'puppy', '-name' => 'doggie_3'})
    (@results - [@doggie_1]).should be_empty

    @results = Product.search_tank('doggie', :conditions => {:tags => 'puppy', 'NOT name' => 'doggie_3'})
    (@results - [@doggie_1]).should be_empty

    @results = Product.search_tank('doggie NOT doggie_3', :conditions => {:tags => 'puppy'} )
    (@results - [@doggie_1]).should be_empty
  end

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.