Encoding results as a JSON dictionary for more efficient indexing.