I have two book (.xpj) projects in one directory. They each have their own TOCs, but the directory has all the topics for both projects.

In project A, the generated help output TOC looks correct, but if I do a search, I get a topic that is not in project A- it is not linked to the book. It is linked to project B. Do you know why the search would come up with this topic?

That is the way it works Erin. The TOC does not control what is searchable as it is perfectly acceptable to have topics that you can navigate to but which do not appear in a TOC. In short any topic included in your output is searchable by default. If you don't want it to be, you have two options.

Use a conditional build tag to exlcude it from the output.

Use the "Exclude from Search" topic property. However in my memory I seem to remember this does not work with CHM files.