What problem are you observing?
Is this expected behavior?
Using /v3/search with offset and limit, you need to specify sort, otherwise results are not accurate. There are duplicates and missed results. See example below
What is the correct behavior?
I would like search results to be accurate without having to specify sort criteria. It makes me lose trust in search results.
What product feature is this related to?
ISC Search API. I only tried v3, not v2024 or beta etc
What are the steps to reproduce the issue?
Using a script (say ruby) compare the search results of the following.
In my example, getting all identities that have an account on source X
Without sort, I had duplicates in the results. and after removing duplicates I had less rows than I had with sort option (which had no duplicates, as expected)
objList = Array.new
offset = 0
count = 250
# This is payload without sort
payload = "{\"indices\":[\"identities\"],,\"query\":{\"query\":\"@accounts(source.id:#{mySource})\"}}"
while count == 250
response = IDNAPI.post_json("#{$config['baseUrl']}/v3/search?limit=250&offset=#{offset}", $config['access_token'],payload)
responseBody = JSON.parse( response.body )
count = responseBody.length
objList = objList.concat(responseBody)
offset = offset + count
puts "Count: #{count}, offset #{offset}, length #{objList.length()}"
end
puts "identitiesList size: #{objList.length}"
objList.each do | identity |
writeToFile(identity)
end
With sort:
objList = Array.new
offset = 0
count = 250
# Note: Without the sort, it was not giving accurate returns, there were duplicates and missing entries
payload = "{\"indices\":[\"identities\"],\"sort\": [\"+name\"],\"query\":{\"query\":\"@accounts(source.id:#{mySource})\"}}"
while count == 250
response = IDNAPI.post_json("#{$config['baseUrl']}/v3/search?limit=250&offset=#{offset}", $config['access_token'],payload)
responseBody = JSON.parse( response.body )
count = responseBody.length
objList = objList.concat(responseBody)
offset = offset + count
puts "Count: #{count}, offset #{offset}, length #{objList.length()}"
end
puts "identitiesList size: #{objList.length}"
objList.each do | identity |
writeToFile(identity)
end
Do you have any other information about your environment that may help?
N/A