Dynamical search

This post descibes a google-like search functionality. We have a search string, populated with all the possible search fields. Population is done via a scheduled event. Now, I am looking for functionality where the user can add multiple searchwords in the searchfield (for example jansen 01-01-2015). Depending on the number of searchwords, the xpath query need to be build, something like [contains(SearchString,SearchWord_1) and contains(SearchString,SearchString,SearchWord_2)] Is there a way to dynamically build the xpath query? Is there a way to sort the result of the query on the best matching result?
1 answers

The first is easy, you could do this via a custom widget or use a java function. I believe there is also a search widget available somewhere i just haven't seen it for a while. Your second question is actually a lot harder, because you would need to determine what it actually means to be "the best" matching result. It is exactly this requirement that made google what they are today.