Thanks Sergey it worked and I have created a func for the same as as to reused this code often. Also on the same topic I was told that to create the first index and then do the switch to read-write you have suggessted and then create the remaining indexes. This way the index automatically disappears when the cursor is closed