You could use just SQL for that. You'd have to have either a file full of words that the code would load and parse and pick three random(could involve categories so the words would actually go together) or a database that holds the words which would then be selected at random using a number generator for each random id of the table. Then you'd query another database using those words. The hard part would be adding words that each one would be used under. For example lets say your asking for three words for a car.

blue, manual, honda

those words picked at random would work but in this case if it were completely random

meteorite pearl ostrich

you wouldn't find a car with those key words unless it was a custom car with ostrich seats, a pearl family color, and a meteorite painted on it or designed into it some how.

You'd need a way to group them so that the target words would reference something similar. It would be a complex task to say the least but certainly nothing to hard. Probably a list for the categories to tell which ones would go together.