Fix search highlighting on warning searches when the extents

were returned out of order by the database.
Add tests for warning searches.