Comments (2)
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.
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)
- How to sort results? HOT 1
- DEPRECATION WARNING: Yajl's JSON gem compatibility API is going to be removed in 2.0 HOT 1
- Can tanker drop records that can't be found? HOT 4
- can't search for words with special chars HOT 2
- Configuration HOT 1
- Facets
- cannot connect to index tank on other port besides 80
- AutoComplete
- rake tanker:functions is not finding defined fnctions HOT 1
- Feature request: access to `query_relevance_score` HOT 1
- Tanker::Utilities.clear_all_indexes throws an exception
- Search through several models HOT 1
- Model.tanker_reindex exception: Invalid document size. It shouldn't be bigger than 100KB. Got 103720 bytes HOT 1
- undefined method `conditions' (Rails 3.2.12, Tanker 1.1.6) HOT 3
- search_tank alters the options hash
- IndexTank::HttpCodeException: Incorrect api call HOT 1
- "indexable?" does not work HOT 1
- Facets?
- Model.tanker_reindex does not clear current index. Just updates?
- How do i define multiple values for category, and then search for it? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tanker.