0

I tried filtering the Inbox which has around 10k emails using a query string and only get a maximum of 250 results. I use paged search but the MoreAvailable property is false and the TotalCount property is 250 even if there are a lot more emails matching the criteria.

var results = service.FindItems(WellKnownFolderName.Inbox,"from: administrator@example.com", view);

However, if i use FindItems without a filter or a query string like this:

var results = service.FindItems(WellKnownFolderName.Inbox, view); 

i get a maximum of 1000 results per page, the MoreAvailable property is true and the TotalCount is accurate(around 10k). This returns all the results in a single call.

How can i get all the results of a query using query string or SearchFilter? I will use paged search due to EWS throttling.

yoxhall
  • 66
  • 1
  • 7

1 Answers1

1

Exchange limits the maximum result set of Exchange Search queries to 250 Items in REST and EWS. with OnPrem Servers this value is adjustable via the MaxHitsForFullTextIndexSearches property https://support.microsoft.com/en-us/help/3093866/the-number-of-search-results-can-t-be-more-than-250-when-you-search-em however in Exchange OnLine (Office365) you can't adjust that value and need to work under the 250 item ceiling.

Glen Scales
  • 20,495
  • 1
  • 20
  • 23
  • I use Exchange 2019 (on prem). I followed the instructions from the link you gave me. I added these lines: ` ` after the tag, in the Microsoft.Exchange.Store.Worker.exe.CONFIG, then restarted Microsoft Exchange Information Store from Services. This didn't change anything when running the search mentioned in the question and i still get only 250 results. I even restarted the machine where the Exchange server is running. No luck. Could it be some user policies i need to edit as well? – yoxhall Nov 18 '22 at 09:24
  • Quick update: As i mentioned in the previous comment, when running the query that i wrote in the question above, I only get 250 TotalCount. But when i filter based on this query string "subject: test" i get the expected results with the TotalCount being 5000. When filtering with this query string "body: test" i only get 250 total count. Any clues on why i have this strange behaviour? – yoxhall Nov 21 '22 at 14:57