Ensure search results are put into JSON and not dropped.

We were doing everything right except adding the search results to a JSON array. Include a test that checks for this as a regression.