3
A
回答
2
我
# ferret_index.rake
desc "Updates the ferret index for the application."
task :ferret_index => [ :environment ] do | t |
MyModel.rebuild_index
# here I could add other model index rebuilds
puts "Completed Ferret Index Rebuild"
end
這個任務是簡化了答案:我告訴它來重建整個索引的每個小時。我在猜測,當我的數據集變得足夠大時,這將非常慢。在這種情況下,我需要跟蹤所有在過去一小時內得到更新的模型實例,並將它們編入索引。
最後,我需要一個cron作業運行rake任務,確保設置環境來「生產」:
cd /rails_app && rake ferret_index RAILS_ENV=production
相關問題
- 1. Acts_as_ferret使用單個索引
- 2. 如何使用Nhibernate重建索引
- 3. 如何使索引不可用,然後在索引中重建
- 4. 如何使用核心重新加載來重建索引索引
- 5. 如何使用PowerShell重建Windows搜索索引?
- 6. 重建索引
- 7. 搜索類似like acts_as_ferret with more_like_this與其他搜索引擎
- 8. 如何重用已使用Apache Lucene創建的索引?
- 9. 重建SQL索引 - 何時?
- 10. 使用Javascript - 重建索引數組
- 11. 如何重建全文索引?
- 12. 如何在Django Haystack中重建索引
- 13. 如何重建「索引」包在Mac OSX
- 14. zend_search_lucene重建索引
- 15. NHibernate.Search索引重建
- 16. 如何使用AOT創建索引?
- 17. 如何創建和使用索引?
- 18. 如何使用pymongo創建索引
- 19. 如何使用splunk web創建索引?
- 20. 如何重建索引多索引熊貓數據框?
- 21. 可可NSIndexSet:多重索引。如何創建索引集,多個索引?
- 22. 如何使用htaccess將引用鏈接重定向回索引
- 23. acts_as_ferret - 如何將搜索限制在少量字段?
- 24. 在InvokeSBFarmUpgrade上重建索引
- 25. 手動重建pycharm索引
- 26. Sitecore索引重建實踐
- 27. 重建索引oracle 10G
- 28. Lucene創建重複索引
- 29. VFP。重新創建索引
- 30. neo4j重建自動索引
對不起,它是「重建」 – why 2010-12-05 09:20:38