You'll have to add to your done function a way to test if it completed. If your just returning plain HTML (which is horrible practice), you could do something like:
var Searchi= setInterval(searchu, 5000);
function searchu(){
$.post("search.php", {userid: "<?php echo $userid; ?>"})
.done(function(data) {
if(data != "No Results Found"){
window.clearInterval(Searchi);
}
$("#chatbox").append( data );
});
};
But you should probably be returning a JSON, and check the number of results returned instead of a direct comparison with your string.