switch index and createIndex to use valueId instead of value