-
Notifications
You must be signed in to change notification settings - Fork 533
Bulk import with Bonsai.io/Heroku and Tire #327
Comments
I too have this issue, and request some direction. |
What Tire needs (and as @karmi and I have discussed) is a way to specify a global default index. When present, a model should use that as its base, otherwise models should create their own indices and use the cluster as their base. From the user's end, this behavior should be invoked with something like this: Tire.configure do
index_url '…'
end From there, it's a matter of tracing through the method calls that either find/create a per-model index, or talk to the cluster directly, and have them check for the presence of a globally defined index. Unfortunately, neither @karmi nor I have had the time to really dig into this yet. I'm guessing a contribution would be welcome? I'd certainly be happy to help test or review any pull requests, just cc me. |
More specifically, Tire needs to separate models by type by default, and use a common index for them, let's say "application wide". Of course, users must be able to specify separate indices for separate models, when needed (eg. when one index would hold millions of data and the other mere thousands, etc). I'll definitely have a look into this, but probably not during May. @nz, I think there are two questions related to Bonsai.io at the moment:
|
That I have no answer to, sorry @toddwschneider. I promise all the requests to
It looks like |
So, the issue here is that And, basically, setting (I do like the implementation of |
@toddwschneider Hi, should be resolved on current master and the |
@toddwschneider Could you confirm the current master and release work with Bonsai? |
I'm running 0.4.2 and haven't been able to get this to work yet, albeit it's complaining about a missing index this time. Tire.configure do
url BONSAI_URL
logger STDERR
end
articles = [
{ :id => '1', :type => 'article', :title => 'one', :tags => ['ruby'], :published_on => '2011-01-01' },
{ :id => '2', :type => 'article', :title => 'two', :tags => ['ruby', 'python'], :published_on => '2011-01-02' },
{ :id => '3', :type => 'article', :title => 'three', :tags => ['java'], :published_on => '2011-01-02' },
{ :id => '4', :type => 'article', :title => 'four', :tags => ['ruby', 'php'], :published_on => '2011-01-03' }
]
Tire.index 'articles' do
delete
create
import articles
end
|
I'll try to get some more thorough manual testing in this week. Justin, can you confirm that the full BONSAI_URL including the index name is in that curl command? Maybe the bulk import method is setting _index incorrectly? Should be easy to verify. Nick Zadrozny On Sunday, May 6, 2012 at 9:47, Justin Palmer wrote:
|
Yeah, it has heroku's generated index. Sent from my iPhone On May 6, 2012, at 12:02 PM, Nick Zadroznyreply@reply.github.com wrote:
|
@karmi I just gave it a try with 0.4.2 and it works! Thanks for the help! |
@toddwschneider Great! |
@caged and @karmi, I think I see what's happening here. @caged, your example code is probably better written like this… Tire.configure do
url "http://index.bonsai.io/"
logger STDERR
end
articles = [
{ :id => '1', :type => 'article', :title => 'one', :tags => ['ruby'], :published_on => '2011-01-01' },
{ :id => '2', :type => 'article', :title => 'two', :tags => ['ruby', 'python'], :published_on => '2011-01-02' },
{ :id => '3', :type => 'article', :title => 'three', :tags => ['java'], :published_on => '2011-01-02' },
{ :id => '4', :type => 'article', :title => 'four', :tags => ['ruby', 'php'], :published_on => '2011-01-03' }
]
Tire.index 'pvz4bww6kn87gz50s6h43tb' do
import articles
end I ran this against an index of mine and it worked. Let me break down a few points about how Tire and Bonsai are interacting here…
So it looks like my hypothesis was partially correct: an incorrect index name was getting passed in for the Maybe I'll tackle that application-single-default-index thing this week… |
@nz - awesome, that worked. I had assumed the URL was structured |
In case anyone is still running into this issue, if you upgrade to a newer version of Bonsai (> v530), they scope accounts by subdomain now instead of path. This works with tire's assumption about url paths. https://devcenter.heroku.com/articles/bonsai |
I have setup Bonsai on my Heroku app following this gist: https://gist.github.com/2041121, and everything seems to work except for the bulk import of existing posts. Any new post gets put into the ES index automatically, but when I try to import old posts, either directly from the Heroku console, e.g.:
or by running
heroku run rake environment tire:import CLASS=Post FORCE=true
, I get this error:[ERROR] Too many exceptions occured, giving up. The HTTP response was: 401 > {"error": "Not authorized: Some endpoints are admin-only, ask support@onemorecloud.com."}
One strange feature is that some of my old posts get imported, but not all, and I can't see any reason why some fail while others succeed. Has anyone else had any luck doing a bulk import into Bonsai? Many thanks for any help!
cc @nz
The text was updated successfully, but these errors were encountered: