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 2015-07-07 23:42:59

mdyason
Member
Registered: 2015-01-20
Posts: 43

Can not make AdvancedSearch work

Please tell me what I am doing wrong in this API call.

{"apiVersion": "1.0.1", 
"action": "Search.AdvancedSearch", 
"inParams": {"sessionId": "dChQvA2,FT,aktILAFJ509qkOyQ6EKpU",
            "query": {"fieldID": 21, "ConditionID": 36, "value": ""},
            "fields": {"metadata": "true"}
            }
}

The result is:

{
  "result": {
    "api": "OK",
    "action": "SEARCH_QUERY_MISSING_FIELD_CONDITION"
  }
}

The relevant part of GetSearchConfiguration is:

[
      "GPS Position",
      21,
      [
        [
          "IS WITHIN 10 km of",
          31,
          8
        ],
......
        [
          "IS MISSING",
          23,
          4
        ],
        [
          "IS PRESENT",
          36,
          4
        ]
      ],
      5,
      [],
      7,
      "IMS Metadata"
    ],

I read this as GPS Position has fieldID = 21 and if I need to know that data is present the ConditionID = 36 and should have a value of "Blank" (4)
Am I reading this incorrectly?

The reply is the same if I just leave out the "value" parameter.  (It should not be required)

I am trying to get a list of all files that have embedded GPS data and I need the metadata for those files returned.  Right now there are only a few of these in our system.  If I can make this work, I will then add other filters to narrow down the results.  However this does lead to another question:  How many images are too many for the system to return an answer?  I imagine that if there are a million images to be returned, something will break?

Offline

#2 2015-07-07 23:53:48

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

Re: Can not make AdvancedSearch work

Where you have:

"query": {"fieldID": 21, "ConditionID": 36, "value": ""}

I think it should be:

"query": [{"fieldId": 21, "conditionId": 36, "value": ""}]

That is, query should be an array of hashes, and within each the keys are case-sensitive (with fieldId and conditionId being the correct versions).

Offline

#3 2015-07-08 15:48:46

mdyason
Member
Registered: 2015-01-20
Posts: 43

Re: Can not make AdvancedSearch work

Thanks Dominic.  I now have it working - sort of.  I thought the GPS data would be returned as part of the Metadata, but it is not.  I need to create a list of all the fileReferences returned by AdvancedSearch then Run files.GetLocationDetails to get the lat and long.

Do you have any idea what the limit is to this type of search - at what point will I break something if I am looking at all photos, and if the list is too long.  Will it actually tell me that there are some that I am missing?  (Initially we will have about 20,000 photos with GPS info but soon that will be millions)

Last edited by mdyason (2015-07-09 23:49:55)

Offline

#4 2015-07-15 18:15:09

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

Re: Can not make AdvancedSearch work

The search configuration page allows the maximum number of results returned to be configured - the result set would be truncated at that point. It is generally best to be as specific as possible, though, for performance; when using the API to maintain data in another system then the 'last changed' field is often a good one to filter on, since you can then keep it down to just those files that may have changed since the last time the job ran.

Offline

Board footer