Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
877 views
in Q2A Core by
Q2A version: 1.8

1 Answer

0 votes
by

This is actually already working in your site. Maybe you just have to tweak it to your needs.

Just open the qa-config.php file and you'll see this. I think it is self-explanatory :)

If a word is used QA_IGNORED_WORDS_FREQ times or more in a particular way, it is ignored when searching or finding related questions. This saves time by ignoring words which are so common that they are probably not worth matching on.

define('QA_IGNORED_WORDS_FREQ', 10000);

The only thing that is worth mentioning is that in a particular way refers to words in title, words in content and words in tags. They are tracked separately.

by
Is there any way to show random posts from the same category as related posts. Then it will be very much related.
by
Yes, but you wanted to make it better by avoiding common words so that's what I answered :) The approach you're suggesting in your comment is more complex and requires some custom coding
by
+1
I actually made it today. There is a plugin called q2a ultimate widgets. Inside it, there is a widget called category posts. I put that widget as the related post in the main area bottom with some CSS edits. Now it's a perfect related post changing randomly. The only drawback is there are only that question links. No profile pics, category other metas etc. But it will do the purpose.
by
As I mentioned in my previous comment, a plugin would be custom coding. Still, it has nothing to do with ignoring common words, which is what you asked and what I answered :/
by
I tried that ignore word frequency thing. Still, no effect as it is a general category website. For a particular niche that ignore word frequency may work. Anyway, now random category posts are working well as related posts. :D
by
Yes, Adjusting the ignored word frequency can make search results way better than before. Thank you
But related posts are not related at all. Must find a way to avoid those common words.
by
Is there any way to avoid some common words like 'How What When Where Can Do Does' etc from the related search? Or add these words to an 'Ignored Words' list?
by
It really depends on each site if they are common or uncommon words. It doesn't really even have to be en English. So it is exactly as I explained in the answer. A common word is a word that exceeds the threshold specified in that constant. If it exceeds then it is ignored
by
Some keywords in a general category site will be more than in numbers than those common words. So an option of ignoring some preconfigured common words is always good.
by
"will be more than in numbers than those common words" => I don't quite get that. If the words are common, then they are ignored by the "Ignore common words" feature. Wouldn't it be redundant for you to specify common words manually that happen to already be common?
by
In a q&a site, all those titles are in question form. So the most common words will be words like ' What when how can do does to I you ' etc. But in some cases, some keywords will be more common than these words. That's why I am asking for a manual way to specify those common words.
by
"But in some cases, some keywords will be more common than these words." => So if a word like "What" has 12449 references and you have a cooking site you're saying that the word "Spoon" might appear 16338 times. It makes sense.

Now, both words exceed the 10000 limit I mentioned in the answer. So they are both automatically ignored. Manually ignoring "Spoon" makes no sense and is redundant. It will only slow the searches unnecessarily. If you still consider this is relevant for you, you can always write a plugin to take care of it
...