Third Light Developer Exchange

Code and templating community forum for developers and software integrators

You are not logged in.

Announcement

If you wish to join the Developer Exchange, please contact your account manager - this is to avoid unnecessary spam in the forums. Many thanks for your understanding.

#1 2014-09-10 15:20:20

Andrei_Grosu
Member
Registered: 2014-06-30
Posts: 8

General/Advanced Search duplicate results on successive requests(10+)

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

#2 2014-09-10 15:26:50

Andrei_Grosu
Member
Registered: 2014-06-30
Posts: 8

Re: General/Advanced Search duplicate results on successive requests(10+)

Edit:

  I also tried to wait for 1,5 seconds between requests and still I received duplicates.

Offline

#3 2014-11-14 11:38:14

dominic
Third Light Staff
Registered: 2013-06-06
Posts: 119

Re: General/Advanced Search duplicate results on successive requests(10+)

Hi Andrei,

I haven't seen this happen before, but I'll have a look. Are you still seeing this behaviour?

Dominic

Offline

#4 2014-12-03 11:31:35

Andrei_Grosu
Member
Registered: 2014-06-30
Posts: 8

Re: General/Advanced Search duplicate results on successive requests(10+)

@dominic :I don't know if this issue persists. I used "Files_GetAssetIdsByFilename" instead.

Offline

#5 2015-02-10 04:26:01

stevec
Member
Registered: 2014-11-28
Posts: 9

Re: General/Advanced Search duplicate results on successive requests(10+)

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

#6 2015-02-12 02:17:19

stevec
Member
Registered: 2014-11-28
Posts: 9

Re: General/Advanced Search duplicate results on successive requests(10+)

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

#7 2015-02-27 01:31:21

stevec
Member
Registered: 2014-11-28
Posts: 9

Re: General/Advanced Search duplicate results on successive requests(10+)

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

#8 2015-03-02 19:31:45

dominic
Third Light Staff
Registered: 2013-06-06
Posts: 119

Re: General/Advanced Search duplicate results on successive requests(10+)

Hi Steve,

I've had a look at this, and I believe we have a fix pending release.

Dominic

Offline

Board footer