How do you programmatically update an asset index? I am trying to update an asset index from a plugin but can't seem to get it to work.  Looking at the docs this seems to me like it should work but it does not. I am on the right path here?

$ses = craft()-&gt;assetIndexing-&gt;getIndexingSessionId();
craft()-&gt;assetIndexing-&gt;processIndexForSource($ses, null, 7);


7 is the id of the asset folder I want to re-index.
This is what I ended up with which works great for me. 

$ses = craft()-&gt;assetIndexing-&gt;getIndexingSessionId(); 
$src = craft()-&gt;assetIndexing-&gt;getIndexListForSource($ses, 7); 

for ($i = 1; $i &lt;= $src['total']; $i++) { 
    craft()-&gt;assetIndexing-&gt;processIndexForSource($ses, $i, 7); 
}