3

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:

  1. SOSL search on all types (one call, multiple objects merged)
  2. SOQL query on all articles from the category you did on KnowledgeArticleVersion (filter for internal only = true)
  3. 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?

2
  • You know that FIND supports WHERE, right? It might help you. FIND {term} IN ALL FIELDS RETURNING Object (Field1, Field2 WHERE SOQL-CONDITION). I don't have time to monkey with this right now, but you can experiment.
    – sfdcfox
    Jul 24, 2013 at 14:15
  • Right - but I basically have to do a SOQL join and I don't think I can do a join on it. The SOQL condition (to my knowledge) only supports it on the exact table you're running the SOSL on.
    – Darkenor
    Jul 24, 2013 at 14:17

1 Answer 1

1

Yes, there is a way to do that:

FIND 'test' RETURNING KnowledgeArticleVersion(Id, Title, Summary WHERE PublishStatus='online' AND Language= 'your language')

You can add a condition on channel and data cateogry inside as it's done with Publish Status.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .