"It was like looking for a needle in a hay stack" is an example of a simile. A simile uses "like" or "as" to describe a situation, event, personality. Other examples of similes are:
figure of speech
figure of speech is a kind of a style. the credit of this is point of figure.
baliw
example of apostrope in figure of speech?
Palindrome
her home was a prison.
kambing
simile
The phrase "on the fence" is an example of an idiom, specifically one that is used to describe someone who is undecided or uncommitted about a particular issue or decision.
Simile
It is a simile
Onomatopoeia