如何使用太阳黑子手动重新索引solr?

Mah*_*h M 5 couchdb sunspot reindex

我有couchdb.太阳黑子正确地索引了一切.但是Solr服务器崩溃了.我需要重新索引整个事情.耙太阳黑子:reindex不会工作,因为它与活跃的记录相结合.sunspot.index(model.all)没有用.即使这样做,solr核心也会说0个索引文档.有出路吗?

s01*_*ist 14

Post.solr_reindex

有许多选项可以传递给solr_reindex.与索引相同的选项; 来自文档

50个批次的索引,每个之后提交

Post.index 
Run Code Online (Sandbox Code Playgroud)

一次索引所有行,然后提交

Post.index(:batch_size => nil) 
Run Code Online (Sandbox Code Playgroud)

批量为50的索引,在所有批次完成时提交

Post.index(:batch_commit => false) 
Run Code Online (Sandbox Code Playgroud)

加载到索引时包含关联的+ author +对象

Post.index(:include => :author) 
Run Code Online (Sandbox Code Playgroud)


Mah*_*h M 3

我正在寻找的是这样的:

Post.index!(模型.all)

当我尝试索引并假设批量提交会自动发生时,发生了一些不好的事情。无论如何,这对我来说效果很好。