Use relative path for documents when querying database

All paths stored in the database are supposed to be relative so you can
move the documents folder without messing up the word count.