Add: definition to check if index has a document