Relevancy is a very difficult algorithm, and I doubt we will implement something like that in miniBB. It's a forums system, and not a search crawler, and it's a not inveting-the-bicycles polygon. Set up Google search or Yandex search bar, if you want it to be similar to the search engine.
The most convenient method to implement stays as I mentioned already. If you search by topic titles and messages simultaneously, script should make two different requests (in general, four different requests - first two for selecting count of records found, to generate pagination string, and second two for actually selecting the results). If search term has been found in topic title(s), these results are shown first (like if you would search by "topic titles"), and the link goes directly to the topic's first page. If search term has been found in message body, these results are shown after (like if you would search by "messages"), and the link goes to the separate message ID.
The only problem I can see here, is how to avoid duplicated results. For example, if search term is found in topic title, it should be excluded from the search by messages; at the same time it causes the determination, how much records should be shown in total. A stick of two endings, as usual.
But if we ignore the duplicated results, general algorithm would be quite simple to understand and develop. |