You have to use the data location returned by the $hfind in the $hget to reference the correct item in the hash table.
For example your code could be searching for the 3rd item that matches the required data, but the 3rd match might be the 50th entry, so $hget(table,3) <which you're currently using> would be the incorrect entry.
Instead try
Code:
/search {
var %hash = seen ,%search = apple, %a = 1, %b = $hget(%hash,0).item
while %a <= %b {
%entry = $hfind(%hash,$+(*,%search,*),%a,w)
if %entry {
echo -s %a : %entry is $hget(%hash,%entry).data
}
inc %a
}
}