Are they in a field? If so, then it is easy to just make use of the stats
command.
your_search | stats count by fieldname
where fieldname is the name of your field.
The result would look like;
fieldname count
HI 2
hi 1
bye 1
BYE 1
Please provide better samples, to get better help.
/Kristian