Utilities to index to database