Indices

Indices

Due to scale considerations a metadata query might return a HTTP 403 error when the metadata template has been applied to more than 10,000 files or folders. A search index can be created to resolve this error for a specific search query.

We expect this limit to be raised but not to be eliminated in the future.

Limitations

To maintain consistency & availability of the Metadata service for all customers, we have a few Query scale limitations.

  • Indexes per Template: Up to 5 indexes/template can be created
  • Field in each index: Each template can have up to 5 fields indexed for filtering

Request an index

At this time you will need to contact the Box Metadata Query team to create an search index.

To create an index, we will need to be informed of the intended query to be run, including the exact values for the from​, ​query​, and ​order_by​ parameters of the request.

An index will then be created and you will be provided with the the name of this index. If you prefer to specify a name for the index please provide that name upon requesting the index.

Indexes are automatically applied during the metadata querying process when more than 10,000 files or folders are being searched. No further action beyond creating the index is needed to have the index applied.

The LIKE, ILIKE, NOT LIKE, and NOT ILIKE operators can not be used in the query for an index.

Example index request

The following is an example request for an index. It is essential to include all the information for the ​from, query, and order_by​ parameters.

Query descriptionReturns files of the type Customer Submission which are associated with a specific Account Number and for which the Status is Pending. Orders the response by the Submission Date.
fromenterprise_123456.customerInfo
queryaccountNumber = :argAccountNum AND status = :argStatus
order_by[{ "field_key": "submissionDate","direction": "desc" }]

Get list of created indices

To obtain a list of indices created for a given metadata template and scope, use the list metadata query indices endpoint.

When making a request to the endpoint, supply the scope of the template (either global or enterprise), as well as the template key.

cURL
curl -i -X GET "https://api.box.com/2.0/metadata_query_indices?scope=enterprise&template_key=properties" \
     -H "Authorization: Bearer <ACCESS_TOKEN>"