Comments (11)
yeah this is one of the main requests. something like a where statement, I will try to come up with a way. Any suggestions on how te api would look¿?
from tanker.
Yeah, something like a where statement, not sure exactly what's the best way. I was hoping there would be a way to just put some conditions around the "indexes" parts inside the tankit statement
from tanker.
I would also like the the ability to specify different indexes depending on Rails.env. Currently I have a yaml file which I've sourced in tanker.rb to conditionally set the index name depending on environment. It works fine, but it sorta sucks that I need both a yaml file and an initialization file.
Maybe tanker.rb could be smarter. With commented code snippets and corresponding documentation explaining different configuration options (e.g. pagination). I'm thinking something similar to simple_form.
Either way, it would be really nice if I could easily say: "Use this index in production. Use this index in staging. And so on."
from tanker.
@coryshires not sure if this makes it any better than your yaml setup, but here's how I have my configs set up so tanker uses the appropriate index depending on environment:
app/config/environments/development.rb:
config.indextank_index = 'development_index_name'
app/config/environments/production.rb:
config.indextank_index = 'production_index_name'
And then in the tankit part of in model, I just have:
tankit Rails.configuration.indextank_index do
(tanker stuff)
end
from tanker.
I am actually of the idea that YML files suck and that there is no reason to have credentials embebed in your ruby files loaded in the config directory. Rails already supports loading different config files depending in the environment or if you want a single file just have logic that uses the Rails.env call. I really want tanker to not be super tied to rails. I do have a railtie that can be extended so feel free to submit a patch I will consider it for sure.
from tanker.
I'm fine with no yaml files. I actually think athst's suggestion will address my concerns.
Once I merge it into my project (and ensure it works, tho I don't see why it wouldn't), I'll probably update the read me to let others know the best way to set conditional indexes.
from tanker.
cool! I am finishing adding support for categories! I am exited for the new features of the gem
from tanker.
FYI - I am still interested in this feature.
I think the API could be pretty simple--i.e.:
tanker :index do
indexes :title
indexes :author
conditions do
published
end
end
Then, if published is true for a particular instance, it will get indexed. If it is false, it will not get indexed.
from tanker.
Still working hard on this, sorry for the delay!
from tanker.
Here's our pull proposal (mine and @vvgomes): #60
from tanker.
Implemented :)
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.