You are not logged in.
Pages: 1
Hello All,
I had a simple app setup around the middle of last year that would get the details of all the images that were uploaded in the last 24 hours. This worked without issue until December 12th of last year while I was away. I have just noticed it isn't doing it's job anymore and it is generating a 500 internal server error. We apparently did an upgrade in late October, but I can't imaging that is the issue since it ran for a month and a half without issue.
API Script:
api.json.tlx?json={"apiVersion":"1.0","action": "Search.AdvancedSearch","inParams": {"query":[{"fieldId":19,"conditionId":-1,"value":"-1"},{"fieldId":119,"conditionId":15,"value":"1"}],"exactMatches":"false","fields":{"metadata":"true"}}}
FieldId 19 = FILE TYPE
conditionId -1 = IS AN IMAGE
FieldId 119 = UPLOAD DATE
conditionId 15 = IS WITHIN THE LAST 'N' DAYS
I have tested this API in postman and it generates the same error. We have also done a reboot on the server and I verified that the fieldId's and conditionId's in our metadata are still correct.
Any help on this issue would be greatly appreciated.
Thanks,
Melissa
Offline
Hi Melissa,
I imagine that the first condition "IS AN IMAGE" is likely to match a rather large number of files - and a number which will have been increasing over time. It is likely that December was the point at which this partial result became too large to process.
I suggest trying the search with the conditions transposed, as just the set of files uploaded in the last day is likely to be quite small. By applying that condition first, you should find that the search will succeed - and it ought to be quite a bit faster, too.
Dominic
Offline
Hi Dominic,
I am not sure what you mean by trying the search with the conditions transposed. Would you be able to provide an example?
Thanks,
Melissa
Offline
{"apiVersion":"1.0","action": "Search.AdvancedSearch","inParams": {"query":[
{"fieldId":119,"conditionId":15,"value":"1"},
{"fieldId":19,"conditionId":-1,"value":"-1"}
],"exactMatches":"false","fields":{"metadata":"true"}}}
- so the order of the search conditions in the query is first the 'in the last 1 day' condition, followed by the 'is an image' condition.
Offline
Thanks Dominic, that worked!
So the order that the query goes in matters. I assumed it worked like a traditional and statement where the two are evaluated at the same time.
Really appreciate the help.
Melissa
Offline
Pages: 1