3

Below query returns 250 records

FIND {*test*} IN ALL FIELDS RETURNING Knowledge__kav(Id, Title WHERE PublishStatus='online' AND Language= 'en_US')

Below query returns 2000 records

FIND {*test*} IN ALL FIELDS RETURNING Knowledge__kav(Id, Title WHERE PublishStatus='online' AND Language= 'en_US' ORDER BY CreatedDate Desc)

Why does 'Order By' determine how many records to return? Is there any document which says to include Order By or something in a sosl query to retrieve more than 250 records?

  • 1
    I see similar behavior in my org. I see this answer salesforce.stackexchange.com/questions/77110/… but isn't super specific or clear – Kris Goncalves Oct 2 '19 at 21:35
  • @KrisGoncalves Exactly, I cannot find any documentation on this limitation. I am perplexed with the behavior of this sosl query. Strange thing is that this is an intermittent issue for some users, sometimes users are seeing 2000 records for the first query and sometimes 250 for the same query. – Sriram Lns Oct 2 '19 at 21:45
1

I have tweaked the query a little bit and it started giving me 2000 records instead of the 250 and you don't have to include "Order By" in the query.

FIND {*test*} IN ALL FIELDS RETURNING Knowledge__kav(Id, Title WHERE PublishStatus='online' AND Language= 'en_US' AND IsLatestVersion = true)

I still couldn't find any documentation yet on this behavior.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.