changed api for custom indexing