2

Original question from Craft Slack:

Is there anyway to hack the AssetIndexTool to start at a certain asset/position/filename/index?

We’re using Rackspace Cloud Files and have around 25k images loaded. However, Cloud Files is limited to returning 10,000 objects per “page”. And it doesn’t look like Craft will paginate these objects. Wondering if we can just hack it to start the asset indexing at a certain place instead of starting at a certain index/filename, etc.

1 Answer 1

2

Found the spot to hack this. It was not within the AssetIndexTool as originally theorized, but in the In RackspaceAssetSourceType in the _getFileList function you can append a marker marker_end and/or limit to the file list.

The marker should just be a URI without the extension. As an example, we change the parameters on $targetUri to look like so:

&format=json&marker=products/BC-174&limit=250';

This will index the items form that marker and effectively ignore all the other assets you have already indexed. Craft will prompt you to delete the items you already have, as they are not found because you have skipped them by hacking the $fileList.

I've found you can safely hit Cancel and your items from the marker range will be imported, and your other indexes will not be affected.

This article is very helpful in finding out what you can do with the marker params.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.