Fixes ajax search issue

Search wasn't working when performed from the details view. This
adjusts the query to work.