My organization frequently does work with SalesForce knowledge. And the recommended way to search Knowledge is either by the exact type of the article that you created in your instance or by the KnowledgeArticleVersion table, which contains the title and the published channels (internal/public/customer portal/app portal). The inherent problem with this is that you inevitably want to search the type of the article with SOSL, but you then need the channels as well - which can only be found in KnowledgeArticleVersion.
The only solution I can find to this is to:
- SOSL search on all types (one call, multiple objects merged)
- SOQL query on all articles from the category you did on KnowledgeArticleVersion (filter for internal only = true)
- Use some basic set merging on the two results and filter the ones that don't have the appropriate channel out.
Ideally, I'd like to be able to run one query on my specific type and intersect it with another table - effectively SOSL search fed to a SOQL filter. Is there a way to do this?