charlie71
07-25-2010, 02:14 PM
Hello everybody,
on our forum we avoid threads with same titles. It wouldn't be a problem to find these threads by search, but we have about 1000 new topics each day. It's almost impossible to find them manually.
I've build a function to find these topics. First, i query the database. Look at my solution:
SELECT COUNT(thread.title) AS counter,
thread.forumid,
thread.title
FROM " . TABLE_PREFIX . "thread
WHERE thread.forumid IN('31,32,33')
GROUP BY thread.title
HAVING counter > 1
ORDER BY counter DESCThis works pretty fine. Now i get a list with topics that have the same title, like this:
Obama created a monster (5 times) (Search them)
BP spills coffee (4 times) (Search them)
...
Ok, "Search them" is my link to forum-search to find these topics. Then i can merge or delete them.
It goes like this:
search.php?do=process&query=BP+spills+coffee&titleonly=1&exactname=1&forumchoice[]=31...
But the forum-search is doing wrong. If i search for topics with EXACT title like "BP spills coffee", it shows me:
BP spills coffee one more time
BP spills coffee yesterday
But i want "BP spills coffee" only! I totally stuck on this. What have i missed in my search-query, or what i need to change? Any suggestions?
on our forum we avoid threads with same titles. It wouldn't be a problem to find these threads by search, but we have about 1000 new topics each day. It's almost impossible to find them manually.
I've build a function to find these topics. First, i query the database. Look at my solution:
SELECT COUNT(thread.title) AS counter,
thread.forumid,
thread.title
FROM " . TABLE_PREFIX . "thread
WHERE thread.forumid IN('31,32,33')
GROUP BY thread.title
HAVING counter > 1
ORDER BY counter DESCThis works pretty fine. Now i get a list with topics that have the same title, like this:
Obama created a monster (5 times) (Search them)
BP spills coffee (4 times) (Search them)
...
Ok, "Search them" is my link to forum-search to find these topics. Then i can merge or delete them.
It goes like this:
search.php?do=process&query=BP+spills+coffee&titleonly=1&exactname=1&forumchoice[]=31...
But the forum-search is doing wrong. If i search for topics with EXACT title like "BP spills coffee", it shows me:
BP spills coffee one more time
BP spills coffee yesterday
But i want "BP spills coffee" only! I totally stuck on this. What have i missed in my search-query, or what i need to change? Any suggestions?