kidpollo / tanker

IndexTank Integration with your fav ORM
MIT License
97 stars 30 forks source link

rake tanker:functions is not finding defined fnctions #62

Closed forest closed 12 years ago

forest commented 12 years ago

$ 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
forest commented 12 years ago

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.