Search Code for a Forum
I programmed my own forum a while ago, quite similar to this one in a way (hierarchical, new threads on each level as well as posts). most people will probably ask why I did this... well, I simply wanted to. however there are still some things missing to make it perfect. I currently have no forum-search and am now wondering how to go about this sensibly. Thought I'd get some feedback on my ideas...
My website is for numerous different teams with their own forums that should therefore not interfere with each other.
I plan to index every unique word from every post, that is larger than 2(or 3?) letters.
the structure would be something like this:
{
teamID
word
list of all postIDs separated by a special character
}
e.g.:{
20,
"hello",
11*22*23*44*55*75*78
}
meaning that "hello" is found in 7 different posts. therefore searching for "hello" would give me the list of all relevant posts fairly quickly. searching for "hello" and "bye" would be done by searching for both words separately and then looking for overlapping posts or joining results depending on what search commands were used.
seems to be a sensible way to me, but I have absolutely no experience in search-engine methods. maybe someone can give me a kick in a better direction before I end up producing garbage.
|