better implementation to store abitrary fields in index