search based on a code