Storing search queries as JSON objects