Changes to allow inverting search results