You're using a string to call the function, and that string gets interpreted in the global scope - as if you'd typed it in the listener; outside the body of your function, 'searchFor' does not exist.
Here's a reference on how maya sees callback commands: http://techartsurvival.blogspot.com/2014/04/maya-callbacks-cheat-sheet.html
MHLester's example will do what you want, you will have to watch out for closures. The lambda will inherit variables from the scope where it is defined -- but at the time the scope closes, not at the time it was defined; this might cause some surprises. For example if you tried this:
def test():
w = cmds.window()
cmds.columnLayout()
example = 1
cmds.button("test", c= lambda *_: sys.stdout.write( "example: %i" % example ) )
example = 4
cmds.showWindow(w)
clicking the button will print '4', even though it looks like it should be '1'.