I second searching for individual words, not permutations. The permutation approach scales horribly: 10 words give you 3.6M permutiations; 12 words give you 480M
Now you might assume the user will never enter more than 6 words, but users have ways of surprising you!