Re-create the $statementUri and the $irsUri arrays when the mode is searchindex. Otherwise, we were ending with unexisting references later in the process.