• Richard Mills
  • 0 Points
  • Member since 2014

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 1

I'm working to identify some options around how to improve our knowledge search performance.

At the moment, our knowledge search is coming from a custom controller where the query seems to be something like this:
public PageReference searchArticle(){
        //Set<Id> articleIds = new Set<Id>();
        SearchArticlesByCategory sabc = new SearchArticlesByCategory();
        allArticlesBySearch = sabc.searchArticlesByCategory(artTypes, visibleCats, searchString, language, prefix, null);
        Integer listSize = allArticlesBySearch.size();
        Integer i;
        for (i = 0; i < listSize; i++){
        articleListBySearch = [SELECT Title,UrlName,Summary FROM KnowledgeArticleVersion WHERE Id IN :articleIds AND Title LIKE :'%' + String.escapeSingleQuotes(searchString) + '%'];
        if(articleListBySearch.size() == 0){
            articleListBySearch = allArticlesBySearch;
        CheckAttInArticle caia = new CheckAttInArticle();
        attInArticle = caia.checkAttInArticle(articleListBySearch, mapContainsAtt);
        setPageState(method_search, articleListBySearch.size());
        return null;

I didn't write this code, but in researching the knowledge search functionality, I've learned that the native Salesforce Knowledge search offers a lot of value in terms of things like tf/idf relevancy, lemmatization, and synonym expansion.   I also know that the newest edition includes default and/or and search term highlighting.

What I'm working to figure out is :
  1. What could be done to improve our existing custom search controller?
  2. Does the search controller as outlined in the knowledge developers guide provide the functionality mentioned above?
  3. Are there any ways to embed the salesforce knowledge search in a custom page without using the knowledge tab or completely recoding?
  4. Would using the connect api and the getSuggestions class be a way to provide more 'instant' results and utilize SFDC's native search power?