我想索引近 900,000 个文档,但这需要很长时间。我定义了一个映射,其中包含以下行的索引:
indexes :residencies_with_year, type: 'string', :as => 'residencies_obj.map{|r| ExpertProfile.residency_with_year_to_s(r)}'
因此,我相信在索引模型时会有很多数据库查询。我使用默认配置:节点数=1,分片数=5,副本数=1。每批 1000 个文档大约需要 15 分钟。
我怎样才能加快速度?
这是我正在使用的 rake 命令
rake environment tire:import CLASS='Expert' FORCE=true