Solr Sunspot - objects with reindexing do not start automatically

I use Sunspot Solr to index and search our Ruby on Rails application using the MangoDB database (Mongo mapper)

The search works well, but objects are not indexed automatically in Solr when I make changes to my database.

I tried to manually index the class itself:

Top.reindex Sunspot.commit

Or, I added to sunspot.yml: auto_commit_after_request: true I will also auto-switch at a certain interval to solrconfig.xml:

<autoCommit>
<maxDocs>10000</maxDocs>
<maxTime>15000</maxTime>
</autoCommit>

All these solutions could not automatically reindex my objects unless I reindex all the objects with the rake command:

bundle exec rake sunspot:reindex 

Any other solutions?

Many thanks.

+4
1

Sunspot , ActiveRecord ( ).

, Mongo, AR. , sunspot mongo mapper . , - , ( this)

, , ActiveRecord, , User:

after_save { |user| Sunspot.index!(user) }
after_destroy { User.reindex; Sunspot.commit }
+3

All Articles