changed api for custom indexing

Hi, 
i've done some changes for supporting a custom index engine with custom metadata