Build index asynchronously in a thread