Whether you've "Liked" a photo or commented on a post, rest assured the social giant is keeping tabs. (You can easily view your history of these kinds of interactions on your account's Activity Log.)
But Facebook isn't just taking note of when you interact with a page or post. The social giant also keeps track of your more passive behavior, specifically your search habits.
Facebook, like Google, keeps a record of every single search you perform on its platform.
In other words, every time you've typed your ex's name into the Facebook search bar, there's a record of the time and date that search was performed.