I have a virtual field weight that changes based on the difference in time between now and object created_at time. I want to update it in Sunspot every 2 hours, so I was planning to call Topic.solr_index.
However I think Sunspot will only index records which are marked dirty. So I guess this wouldn’t work. My questions are:
- How to index this kind of non-dirty current-time-dependent fields in Sunspot
- How can I check that
weighthas been updated correctly in solr admin(or any other way to check indexing result)
My assumption was wrong.
If I have a weight method, which outputs true/false based on the current time (say true if now is the morning), eventhough the model is not marked dirty, Sunspot will still index that properly every time.