How are search results ordered?

I have a moderately sized forum regarding DIY electronics, currently running vb4. It has a lot of really great content buried in about 50000 posts on about 6000 threads.

The main user complaint is the uselessness of vb4's search function. My users often wish to search for answers to their technical questions. Everyone benefits if they can find high quality answers easily. Duplicate conversation are avoided, I and others spend less time answering questions over and over, and most importantly, people building DIY electronic projects can get the technical info and answers they need quickly!

The problem is a lack of useful ordering or ranking of vb4's search results. Common keywords return hundreds of threads. The few threads with really great answers and info are lost in a sea of low-value casual conversation. vb4's search seems to order the results randomly. Even determined users quickly tire of page after page of low value threads in random order.

Compare with Google, where the first 5 results are almost always the highest quality pages! Google and Bing and others pretty much define what people expect from search. vBulletin4 falls far short, with virtually worthless needle-in-haystack results.

My hope is for search results to be ordered by factors that suggest the quality of the threads, like the number of people who have "liked" the posts, or the presence of links from other threads (a very strong indication the thread with the link is a low value duplicate and the one targeted is a high quality answer), or the number of views, etc.

Can XenForo help?
Last edited:


XenForo moderator
Staff member
Standard MySQL search will likely be the same as you have now.

The Enhanced Search add-on though allows for relevance weighting and other tuning possibilities, if you are prepared to customise it.

You can test it on this forum as it's installed here.
Also on the online demo.
Over the last few days, I've been reading up on elasticsearch. It seems incredibly powerful and capable! The JSON-based query language has amazing features, like boosting the relative weight on relevancy for many search factors.

As I keep reading more, I keep wondering how much of the forum's meta data XenForo is actually exporting to elasticsearch?

For example, adding extra clauses to the JSON search query to boost relevancy based on the number of "likes" seems fairly straighforward, if XenForo actually puts the "like" info into a field when it sends data to elastic search. But if the likes aren't exported, then trying to incorporate them into the search seems like it'd first involve crafting a mod just to get extra data into elasticsearch? Likewise for links, attachments, etc?

I know this is probably too technical of a question, but is there any chance to see the mapping XenForo is using with elasticsearch?

Or on the online demo forum, is there any way to access port 9200 for elasticsearch?


XenForo developer
Staff member
The demo doesn't use Elasticsearch and giving access to ES is usually considered to be a big security issue.

It's mostly just the content and roughly unchanging metadata that is indexed. This does not include likes.
Thanks Mike, for taking the time to answer. It's pretty awesome you guys spend time on your forum!

I realize improving search probably isn't a high development priority, but do you suppose there's any chance XenForo might move towards exporting more meta data into elasticsearch?

My hope is to at least work toward something like the search features described here: (especially the "how good is the content" part)

How good is the content? As I said in the previous point: forums generate a lot of content and not all of it is good. Well, with our reactions system we provide users with a way of curating the content in your community. When users react positively to a post then it increases in score. When users react negatively to a post then it decreases in score. This score contributes to a post’s search rank.
I feel pretty good about tuning elasticsearch queries. Not sure if I'll be able to dig deeply into XF to export the more meta data.

Daniel Hood

Well-known member
Extending search functionality is pretty easy once you learn how to extend core XenForo classes (using the class proxy system). At that point, you can send extra meta data very easily.
I just purchased XenForo and the enhanced search add-on. :)

While Vanilla seems to have put more work into improving search relevance, I'm just not comfortable with their hosting-oriented business model. Hopefully with some hacking and fiddling I can get at least some level of user feedback to influence the search ranking.

Daniel Hood

Well-known member
Welcome to XenForo.

Search results are a hot topic for all forum software. Everyone wants to improve their results. I'd be interested in getting with you on making something that accomplishes this. If you're really that comfortable doing the querying and thinking of formulas to improve the results, I can help get the data inserted into ES.
Yes, I definitely intend to work on this. But realistically, it'll be a little while until I can do much. First need to get my vb4 forum migrated. I've got a really great group of active users, but even with their help, it's going to take time to build up a useful set of "likes" on content. Maybe other stuff can also factor into improving relevancy, but my gut feeling is the number of likes is probably the best indicator of content's value. Maybe links and media people went to the trouble of putting into their messages might also help?

I'll certainly need a little help! My background is mostly in circuity, C, C++ and assembly programming on microcontrollers. I've dabbled in server side stuff using php and mysql, even written a few small but working projects, but that's far from my core expertise.

Sadik B

Well-known member
Working on a very popular forum, we did develop something similar. It was not on a migration though, we already were running XenForo for over a year.

The objective was to list the best threads of the forum every week. We were also using the Post Ratings add-on by Luke Foreman. So we took the following indicators, number of views for the thread, total positive ratings (similar to likes) and total number of replies received. We assigned different weights to each of the three indicators and for every week listed the best threads this week kind of thing. The week period was intentional because this forum generated a LOT of threads and it was important to show the best current threads, but we could have as well done this for the entire lifetime of data.

This was NOT done by extending search though. We created a new forum which picked these best content from all other nodes and displayed the results as a thread list just like a regular forum's thread list. I understand your objective is to give better quality search but this is an idea simpler to implement if you want to highlight the best contents from your site for your members.