Attempt at preventing duplicate insertion.

This should prevent the same note from being added several times. If a note is
indexed more than once then the document is simply updated in the database.
Using this will require reindexing all notes because it adds a term to each
document to track it.
doc -> document in index.