Searching a string with text search say that:

var stringToTest = "Hello i am walking"

And 

var searchText = "Hello walking"


I have the following javascript function for filtering.

var searchSplit = searchText.split(" ");
var num_split = searchSplit.length;
var correctTested = 0;
searchSplit.forEach(function (testString) {
    if (stringToTest.indexOf(testString) &gt;= 0) {
        correctTested++;
    }
});

//Decides if the value are close enough
if (correctTested &gt; 0) {
    var percentageCorrect = correctTested / num_split * 100;
    return percentageCorrect &gt;= 50;
}
else {
    return false;
}


I have never done anything like this and i would like if you would rate or even come with suggestions on how to improve the above code.
My suggestions are mostly focused on making the code as concise and clear as possible.


Simplify the return statement.  

if (correctTested &gt; 0) {
    var percentageCorrect = correctTested / num_split * 100;
    return percentageCorrect &gt;= 50;
} else {
    return false; 
}


can be reduced to

return correctTested &gt;= num_split * 0.5;


This eliminates both the condition as well as concern about div by 0.
Since you do not need a post-increment, choose pre-increment.
++correctTested or correctTested += 1 rather than correctTested++.
Choose clear names.

searchSplit might be clearer as searchTokens, correctTested as matchedTokens, num_split as tokenCount.
Consistent names.
searchCase is camel case while num_split is snake case.
You have not articulated the functional spec, but consider whether the search should be case-insensitive.  Also consider whether partial word matches are in fact acceptable or whether you require full token matches.


For ease of testing and for the ability to add different decision criteria you could consider decomposing match counting and the decision criteria into two separate functions.