kidpollo / tanker

IndexTank Integration with your fav ORM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rake tanker:functions is not finding defined fnctions

forest opened this issue · comments

$ rake tanker:functions
reindexing all IndexTank functions
No IndexTank functions defined.
Define your server-side functions inside your model's tankit block like so:

  tankit 'myindex' do
    functions do
      {
        1 => "-age",
        2 => "relevance / miles(d[0], d[1], q[0], q[1])"
      }
    end
  end

I have the following defined in my model:

tankit do
    functions do
      {
          0 => "-age",
          1 => "relevance / miles(q[0], q[1], d[0], d[1])",
          2 => "miles(q[0], q[1], d[0], d[1])"
      }
    end
end

I found the issue. The functions and categories are not being copied over from the config to the tanker_config in the tankit method. I believe the issue is only exposed when you are extending your index definitions with some defaults as described here: https://github.com/kidpollo/tanker#extend-your-index-definitions

I will send a pull request when I verify and fix.