update query and add src/merge-indri-ret.pl