There are a few ways to tag items for search, but the easiest is to go into your junk inventory and enter component view, you can mark anything you have for search here. If you want to find something you don't have, say for a weapon mod, you can hit the button (it will tell you on-screen) and it will tag all items required for building for search. To do this you have to be at a workbench and highlighting a mod you want to build, items you don't have will be greyed out.
Now once you've tagged an item, you will see a magnifying glass icon next to the name of any junk items that can be broken down into that item. If you were to tag adhesive, junk items like wonderglue and duct tape would have the magnifying glass next to their name. It will appear at all times, whether it's sitting out in the open or in the inventory of something like a toolbox or enemy.