function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sanchivan SivadasanSanchivan Sivadasan 

Salesforce Knowledge Query issue

I am using Salesforce Knowledge and following the example Salesforce Knowledge Developers guide (http://www.salesforce.com/docs/developer/knowledge_devpre/index.htm)

 

I got everything working except the paging part. I have about 13 articles which I created for testing. Everything works fine, but when I search and if there is less than 10 records that matches the search it still shows the next button. I found that the Query still return's the same result even if you put the filter condition.

 

String queryString = 'FIND \'11*\' IN ALL FIELDS RETURNING KnowledgeArticleVersion(Id, title, UrlName, LastPublishedDate,LastModifiedById where PublishStatus =\'online\' and Language = \'en_US\') WITH DATA CATEGORY Sports__c ABOVE_OR_BELOW Baseball__c';
List<List<SObject>> searchList = search.query(queryString);
List<KnowledgeArticleVersion> articleList = (List<KnowledgeArticleVersion>) searchList[0];
Integer maxSize = articleList.size();
System.debug('maxSize : ' + maxSize);

 In this case it still return's 13 even thought here is only 1 record with 11. Did anyone have the same issue? 

Anju Chacko QBAnju Chacko QB

you got any solution for this? I am facing the same issue..