Skip to main content
Question

Search Api Problem

  • May 22, 2025
  • 6 replies
  • 63 views

Forum|alt.badge.img

I have been facing a problem when using a search api. basically I am using a keyword like 'JAN-18' to find out the files which contains the keyword. As we knows that  Search api has limit to return maximum of 200 files per api call. As i have thousands of files that contains that keyword like JAN-18 and i have a scenario to move that files which contain that keyword .so i have to apply the iteration unless all file moved containing that particular keyword to the destination folder.So In first iteration it is giving me the files and i am using another api to move those files to the destination folder and it is getting moved to destination folder and counter is getting decrease from the ancestor folder.

 

for reference :

 

"https://api.box.com/2.0/search?query=JAN-18&ancestor_folder_ids=7628771&type=file&file_extensions=pdf&limit=200&content_types=name"

 

But now the problem arises here is , on my 2nd iteration it is giving me  the same set of files and same total count no. as it is giving me in the first iteration despite the files are  not now present in the ancestor folder/source folder. I wonder why ?

 

but if i do another iteration after some time then it is giving me different total count from api.

 

Is there any tool or framework that search api using for indexing like apache solr that takes some time to update the indexing. please let me know the reason behind it.

 

Please suggest the solution or any workaround for this problem.

6 replies

Forum|alt.badge.img

 According to the Search API documentation"Newly added or changed items are indexed and available via Box search in less than 10 minutes in most cases. The current service load determines the index time and it may take more than 10 minutes in some cases."  So, after moving the files it may take some time before those changes are reflected in the search results.


Forum|alt.badge.img

It means if we are using search api to fetch files then on 2nd iteration we should apply timeout of 10 minutes to get the right count or to fetch different set of files ?


Forum|alt.badge.img

 As noted in the documentation snippet I posted, the indexing delay isn't deterministic, and may be longer or shorter than 10 minutes.  So, a 10-minute timeout will likely help, but isn't guaranteed to produce exactly the results you're looking for.


Forum|alt.badge.img

Actually applying timeout is not a good approach . Is there any such api to check whether the indexing of search api has been done or not  or other alternate to determine the indexing time?  or any workaround to tackle this indexing problem through any api ?

 

Can we maximize the limit to fetch files around 1000 files or beyond that through search api ?


Forum|alt.badge.img

 Unfortunately, there is no such API for determining when indexing has been performed.  Per the Search API documentation, the maximum number of results that can be fetched per Search API call (by setting the `limit` query parameter) is 200.


Forum|alt.badge.img

Thanks   for answering to my queries !!