Finding a needle in a haystack would be easier than what we're trying to do

Finding a needle in a haystack would be easier than what we’re trying to do.

in a haystack (prepositional phrase as adverb)

Why is it adverb here ? Why not indirect object?

The indirect object is the noun phrase the receives something.

I gave the book to Mary - Mary is the IO.
She wrote a letter to her sister - her siste rin the IO.

In a haystack simply tells you where.