Am using ews-java-api to connect exchange mail box and search the text "ABCD" which is the subject of the email
i have used the code similar to the one in https://www.tabnine.com/code/java/methods/microsoft.exchange.webservices.data.search.ItemView/setPropertySet
When it searches first time it is able to retrieve the exact no of results. in my case it is 18. After sometime there was another email triggered in the inbox and rerunning the same code has just brought same count of 18 emails where as the actual count in the inbox is 19
can you please help
connectViaExchange();
ItemView view = new ItemView(100);
view.getOrderBy().add(ItemSchema.DateTimeReceived, SortDirection.Ascending);
view.setPropertySet(new PropertySet(BasePropertySet.IdOnly, ItemSchema.Subject, ItemSchema.DateTimeReceived));
FindItemsResults<Item> results = service.findItems(WellKnownFolderName.Inbox, new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.ContainsSubstring(ItemSchema.Body, emailSearchString)), view);
int count = results.getTotalCount();
``` System.out.println("Total No of Emails based on the search performed is: "+count);