Halfway through getting search to work