How can I make MarkedDataSearch() function to search for all EvidenceLocks including 2 newly created in the EvidenceLock sample.
Which version of Xprotect and SDK are you using?
This code snippet is responsible for searching.
var searchResult = client.MarkedDataSearch(
token,
devicesToCreateLockOn, // use empty array to search on all devices
null, // Use null to not search for text
null, // Use null to search for all users
DateTime.UtcNow.AddHours(-1),
DateTime.UtcNow.AddSeconds(-10),
DateTime.MinValue.ToUniversalTime(), // Look for all evidence locks - use
DateTime.MinValue.ToUniversalTime(),
DateTime.MinValue.ToUniversalTime(),
DateTime.MinValue.ToUniversalTime(),
DateTime.MinValue.ToUniversalTime(),
DateTime.MinValue.ToUniversalTime(),
0,
100,
SortOrderOption.CreateTime,
true
);
Evidence sample output should look like:
I could able to get the newly created evidence locks after increasing sleep time from 20 sec to 60 sec. why does it takes such a huge time to update database?
We will investigate it.
This is how the Recording Server works. We will investigate this at Milestone for future improvement but for now you will have to introduce the wait same as the EvidenceLock sample does.
After looking further into this we have found out that the problem is in the sample and not the database update time.
The first two timestamp parameters in the MarkedDataSearch are for delimiting the creation time of the evidence locks being returned and since the sample specifies this to be between (NOW minus 1 hour) and (NOW minus 10 seconds) it will have to wait until at least 10 seconds after creating them before these will be within the result set.
So a better search would be the following which we will also update the sample to be for the 2020 R1 release:
var searchResult = client.MarkedDataSearch(
token,
devicesToCreateLockOn, // use empty array to search on all devices
null, // Use null to not search for text
null, // Use null to search for all users
DateTime.MinValue.ToUniversalTime(),
DateTime.MinValue.ToUniversalTime(),
DateTime.UtcNow.AddHours(-1),
DateTime.UtcNow.AddSeconds(-10),
DateTime.MinValue.ToUniversalTime(),
DateTime.MinValue.ToUniversalTime(),
DateTime.MinValue.ToUniversalTime(),
DateTime.MinValue.ToUniversalTime(),
0,
100,
SortOrderOption.CreateTime,
true
);
Hi Peter,
Thanks for the updates.
