Search API not returning old files
We're seeing an issue where a file uploaded in 2018 is not returning from the search API even though the same file is returned when querying the folder directly from the /folders/:folder_id/items/ endpoint. I've included the two GET requests I'm making to the API below. Both are with the exact same credentials so this shouldn't be a permissions issue and the file is not trashed:
https://api.box.com/2.0/folders/51771072098/items?fields=id,name,sha1,etag,sequence_id,description,size,created_at,modified_at,trashed_at,purged_at,content_created_at,content_modified_at,item_status,created_by,shared_link,modified_by,owned_by,parent,path_collection,lock&offset=0
{"type":"file","id":"306860946745","etag":"0","sequence_id":"0","name":"Customer.mdb","sha1":"c1d6203bf4e66594d6c97b63489d4387942d1a73","description":"","size":126976,"created_at":"2018-07-23T23:45:55-07:00","modified_at":"2018-07-23T23:45:55-07:00","trashed_at":null,"purged_at":null,"content_created_at":"2018-04-22T19:02:02-07:00","content_modified_at":"2018-04-22T19:02:02-07:00","item_status":"active","created_by":{"type":"user","id":"3850777650","name":"myAccount Box","login":"myAccount.Box@gmail.com"},"shared_link":null,"modified_by":{"type":"user","id":"3850777650","name":"myAccount Box","login":"myAccount.Box@gmail.com"},"owned_by":{"type":"user","id":"3850777650","name":"myAccount Box","login":"myAccount.Box@gmail.com"},"parent":{"type":"folder","id":"51771072098","sequence_id":"0","etag":"0","name":"Data"},"path_collection":{"total_count":2,"entries":[{"type":"folder","id":"0","sequence_id":null,"etag":null,"name":"All Files"},{"type":"folder","id":"51771072098","sequence_id":"0","etag":"0","name":"Data"}]},"lock":null}
https://api.box.com/2.0/search?query=Customer.mdb&type=file&offset=0
{"total_count":0,"entries":[],"limit":30,"offset":0}
Note that this behavior is not observed with newly uploaded files (after allowing for the ~10 minute indexing time). Do you have any idea why we'd be seeing this behavior only for older files? I can't find any indication in the documentation on why this would be occurring.
-
Hello,
Hmm. Can you try one thing for me? In your search call use an exact match search in the query param so it's: https://api.box.com/2.0/search?query="Customer.mdb"&type=file&offset=0
Best,
Kourtney, Box Developer Advocate
-
Hi Kourtney,
Unfortunately, that also doesn't work. This was my URL, but the Customer.mdb file from the Data folder was not returned:
https://api.box.com/2.0/search?query=%22Customer.mdb%22&type=file&offset=0
Please sign in to leave a comment.
Comments
2 comments