Added code for creating an index and multiple fields for each document.