Missing \Db::quote()
Optimization: delete and re-insert keywords only if they are modifications for the current item
Optimization: save date of indexation only if keywords have changed
Force 'field_date_indexation' if not yet setted

Useful if the field is added after first indexation
Bugfix: prevent corrupting the table with foreign_id=0

This could happen before when deleting an indexed model (because mooc_join_table is not part of the key in the relation).
If you have corrupted values in jayps_search_word_occurence, you should reindex the full table.