我应该怎么做才能加快狮身人面像索引(使用MySQL)? 我应该使用其他数据库,noSQL数据库吗?狮身人面像重建索引需要几个小时
请注意,增量索引速度很快,只有完全reindeinx过程很慢。 请详细解释。谢谢!
更新: 我重新索引超过10万项,我的思想,狮身人面像索引定义是这样的
define_index do
indexes [text, user(:nickname), user(:full_name)]
has rewrites(:id), :as => :rewrite_id
has rewrites(:user_id), :as => :rewrite_user_id
has [rewrites(:user_id), user_id], :as => :user_id_or_rewrites_user_id
has comments(:user_id), :as => :comments_user_id
has simbols(:id), :as => :simbol_ids
has followings(:follower_id), :as => :follower_id
has follows(:followable_id), :as => :followable_id
has created_at, :sortable => true
has rewrites_count, :sortable => true
has relevance, :sortable => true
has user_id
set_property :delta => :datetime
end
请提供一些细节。您索引了多少项目?在哪里花费大部分时间索引?你有日志输出吗?我已经为成千上万篇带有多个索引字段的文章编制了索引,通常需要几分钟的时间。 – Todd 2010-12-18 22:39:40
@Todd:我刚刚更新了我的问题。 – xpepermint 2010-12-18 22:48:36
您是否试图确定大部分加工过程在哪里进行?如果它在mysql中,可能需要更好地索引表。也许尝试手动运行狮身人面像正在使用的查询,看看它是如何做的。我倾向于说这可以加快。我只是在10k +记录上重新获得了一个完整的索引,并且耗时<1分钟。 – Todd 2010-12-18 23:15:42