Despite many real (though also some exaggerated) counter-examples, Facebook does have features to protect privacy.
One of those things is you generally can't get very useful results from search unless you're friends with someone, or a friend of a friend (depending on the user's privacy settings). You can't see general trends, or even search for every person with a given first and last name in an area, for example.
It used to be more open, but they've heavily restricted the breadth of data returned from searches within the past few years.
Ditto. I have seen this as a crippling deficiency in the Facebook platform. Not being able to search properly in my own posts or in the groups I'm a member of really sucks. For all the engineering prowess, open sourced tools, etc., shown by Facebook, the lack of a working search makes the company seem incompetent from the top down.
Sometime ago I started storing important information (like others links, my own comments, etc.) outside of Facebook where I can find them easily. I also started a Facebook page and added Notes into it to make it easier to document, find and share things. It seems ridiculous that I'd have to do this just to have access to information, but that's been the sad state for years.
FB search is terrible because there is no incentive for an engineering team to work on it, and in fact maybe quietly discouraged from doing so. FB make money on from the news feed, so any feature that distract users from scrolling down their feed will come up losing on an A/B test where ultimate metric is ad views and clicks.
It's only broken because most people share with their friends only and search cannot expose their posts. This makes real time search way less efficient than twitter.
That's what security trimming is for. You index everything, including the permissions for each item and provide the searcher's permissions (whether it's an acl, a claim, or some other form) as part of the query. Anonymous or unauthenticated users get a "public" claim that only returns results available to everyone.