Git Product home page Git Product logo

Comments (11)

kidpollo avatar kidpollo commented on June 25, 2024

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.

jon-n avatar jon-n commented on June 25, 2024

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.

coryschires avatar coryschires commented on June 25, 2024

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.

jon-n avatar jon-n commented on June 25, 2024

@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.

kidpollo avatar kidpollo commented on June 25, 2024

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.

coryschires avatar coryschires commented on June 25, 2024

@kidpollo

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.

kidpollo avatar kidpollo commented on June 25, 2024

cool! I am finishing adding support for categories! I am exited for the new features of the gem

from tanker.

timbauman avatar timbauman commented on June 25, 2024

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.

kidpollo avatar kidpollo commented on June 25, 2024

Still working hard on this, sorry for the delay!

from tanker.

herval avatar herval commented on June 25, 2024

Here's our pull proposal (mine and @vvgomes): #60

from tanker.

kidpollo avatar kidpollo commented on June 25, 2024

Implemented :)

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.