You are not logged in.
Hello,
I am using your search functions from the API and the PHP Client that you provided in the documentation to get a large number of " IMS File Reference" from a list of filenames. For this I have two options :
use Search_GeneralSearch(array("query"=>$filename, "exactMatches"=>"false")) or $fieldId=3;//
$fieldId=3;// filename
$conditionId = 3; // is
$arrInParams =
array(
"query" => array(
array("fieldId" => $fieldId, "conditionId"=> $conditionId, "value"=> $filename)
)
);
$outParams=$this->Search_AdvancedSearch($arrInParams);
This methods work ok if I run a single request, but I noticed that for 10+ successive requests I will get an response for a previously sent filename. I provided below an output of an example with 10 requests for advanced search: you will see 10 pairs of input parameters and output parameters for advanced search that will highlight the issue I mentioned.(filename "cva45965.tif" receives [id] => 24728830708, [parentId] => 21051188603, [filename] => cva45964.tif)
(I removed some fields from the response because they we're not relevant and it seems that I am not allowed to post links.)
Thank you!
(
[apiVersion] => 1.0.1
[action] => search.AdvancedSearch
[inParams] => Array
(
[query] => Array
(
[0] => Array
(
[fieldId] => 3
[conditionId] => 3
[value] => cva45959.tif
)
)
)
)
END OF INPUT <br/>Array
(
[result] => Array
(
[api] => OK
[action] => OK
)
[outParams] => Array
(
[files] => Array
(
[0] => Array
(
[id] => 24728782976
[parentId] => 23505666627
[filename] => cva45959.tif
...............
)
)
[folders] => Array
(
)
)
)
END OF OUTPUT<br/>Array
(
[apiVersion] => 1.0.1
[action] => search.AdvancedSearch
[inParams] => Array
(
[query] => Array
(
[0] => Array
(
[fieldId] => 3
[conditionId] => 3
[value] => cva45960.tif
)
)
)
)
END OF INPUT <br/>Array
(
[result] => Array
(
[api] => OK
[action] => OK
)
[outParams] => Array
(
[files] => Array
(
[0] => Array
(
[id] => 24728789533
[parentId] => 23505666627
[filename] => cva45960.tif
.........
)
)
[folders] => Array
(
)
)
)
END OF OUTPUT<br/>Array
(
[apiVersion] => 1.0.1
[action] => search.AdvancedSearch
[inParams] => Array
(
[query] => Array
(
[0] => Array
(
[fieldId] => 3
[conditionId] => 3
[value] => cva45961.tif
)
)
)
)
END OF INPUT <br/>Array
(
[result] => Array
(
[api] => OK
[action] => OK
)
[outParams] => Array
(
[files] => Array
(
[0] => Array
(
[id] => 24728799256
[parentId] => 23505666627
[filename] => cva45961.tif
.............................
)
)
[folders] => Array
(
)
)
)
END OF OUTPUT<br/>Array
(
[apiVersion] => 1.0.1
[action] => search.AdvancedSearch
[inParams] => Array
(
[query] => Array
(
[0] => Array
(
[fieldId] => 3
[conditionId] => 3
[value] => cva45962.tif
)
)
)
)
END OF INPUT <br/>Array
(
[result] => Array
(
[api] => OK
[action] => OK
)
[outParams] => Array
(
[files] => Array
(
[0] => Array
(
[id] => 24728811280
[parentId] => 23505666627
[filename] => cva45962.tif
............................
)
)
[folders] => Array
(
)
)
)
END OF OUTPUT<br/>Array
(
[apiVersion] => 1.0.1
[action] => search.AdvancedSearch
[inParams] => Array
(
[query] => Array
(
[0] => Array
(
[fieldId] => 3
[conditionId] => 3
[value] => cva45963.tif
)
)
)
)
END OF INPUT <br/>Array
(
[result] => Array
(
[api] => OK
[action] => OK
)
[outParams] => Array
(
[files] => Array
(
[0] => Array
(
[id] => 24728821908
[parentId] => 23605156931
[filename] => cva45963.tif
...................................
)
)
[folders] => Array
(
)
)
)
END OF OUTPUT<br/>Array
(
[apiVersion] => 1.0.1
[action] => search.AdvancedSearch
[inParams] => Array
(
[query] => Array
(
[0] => Array
(
[fieldId] => 3
[conditionId] => 3
[value] => cva45964.tif
)
)
)
)
END OF INPUT <br/>Array
(
[result] => Array
(
[api] => OK
[action] => OK
)
[outParams] => Array
(
[files] => Array
(
[0] => Array
(
[id] => 24728830708
[parentId] => 21051188603
[filename] => cva45964.tif
...........................
)
)
[folders] => Array
(
)
)
)
END OF OUTPUT<br/>Array
(
[apiVersion] => 1.0.1
[action] => search.AdvancedSearch
[inParams] => Array
(
[query] => Array
(
[0] => Array
(
[fieldId] => 3
[conditionId] => 3
[value] => cva45965.tif
)
)
)
)
END OF INPUT <br/>Array
(
[result] => Array
(
[api] => OK
[action] => OK
)
[outParams] => Array
(
[files] => Array
(
[0] => Array
(
[id] => 24728830708
[parentId] => 21051188603
[filename] => cva45964.tif
..............................
)
)
[folders] => Array
(
)
)
)
END OF OUTPUT<br/>Array
(
[apiVersion] => 1.0.1
[action] => search.AdvancedSearch
[inParams] => Array
(
[query] => Array
(
[0] => Array
(
[fieldId] => 3
[conditionId] => 3
[value] => cva45966.tif
)
)
)
)
END OF INPUT <br/>Array
(
[result] => Array
(
[api] => OK
[action] => OK
)
[outParams] => Array
(
[files] => Array
(
[0] => Array
(
[id] => 24728845151
[parentId] => 21051188603
[filename] => cva45966.tif
[filesize] => 30591880
............................
)
)
[folders] => Array
(
)
)
)
END OF OUTPUT<br/>Array
(
[apiVersion] => 1.0.1
[action] => search.AdvancedSearch
[inParams] => Array
(
[query] => Array
(
[0] => Array
(
[fieldId] => 3
[conditionId] => 3
[value] => cva45967.tif
)
)
)
)
END OF INPUT <br/>Array
(
[result] => Array
(
[api] => OK
[action] => OK
)
[outParams] => Array
(
[files] => Array
(
[0] => Array
(
[id] => 24728855989
[parentId] => 21051188603
[filename] => cva45967.tif
............................
)
)
[folders] => Array
(
)
)
)
END OF OUTPUT<br/>Array
(
[apiVersion] => 1.0.1
[action] => search.AdvancedSearch
[inParams] => Array
(
[query] => Array
(
[0] => Array
(
[fieldId] => 3
[conditionId] => 3
[value] => cva45968.tif
)
)
)
)
END OF INPUT <br/>Array
(
[result] => Array
(
[api] => OK
[action] => OK
)
[outParams] => Array
(
[files] => Array
(
[0] => Array
(
[id] => 24728863885
[parentId] => 23505666627
[filename] => cva45968.tif
..........................
)
)
[folders] => Array
(
)
)
)
END OF OUTPUT<br/>
Offline
Edit:
I also tried to wait for 1,5 seconds between requests and still I received duplicates.
Offline
Hi Andrei,
I haven't seen this happen before, but I'll have a look. Are you still seeing this behaviour?
Dominic
Offline
@dominic :I don't know if this issue persists. I used "Files_GetAssetIdsByFilename" instead.
Offline
Dominic,
I'm occasionally seeing this behaviour too. My application is running Search.AdvancedSearch with one set of parameters, then running a bunch of calls to other functions before running Search.AdvancedSearch again with a completely different set of parameters. The response to the second search is sometimes the same as the first.
My workaround at the moment is to compare each search response to the last one, and if they are the same run the search again. It would be nice if I didn't need to do that.
Offline
Correction: it's not always the last response to Search.AdvancedSearch that gets repeated, sometimes it's 2 or 3 calls (and a few minutes) later. So my simple workaround isn't always valid, and I need to compare to several previous responses before rejecting and running the search again.
Of course it's entirely possible that consecutive searches could return valid identical results, which complicates things even further.
Offline
Could I please get some sort of confirmation that this bug is being looked at?
The only reliable way I've found to ensure I don't process duplicated search results is to keep a log of the last 10 responses, and if the latest response matches one of them, log out and log back in to the API and reissue the search request. It's incredibly inefficient.
Offline
Hi Steve,
I've had a look at this, and I believe we have a fix pending release.
Dominic
Offline