Search Bug/Tag Bug

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-10-2006, 11:33 PM
New Pligger
 
Join Date: Apr 2006
Posts: 4
Hi,
If you click in the tag cloud a tag that is three characters or less it gives no results. Same goes for search fields. I have tried this at my site, as well as Ashtest1 and others.

Reply With Quote
  #2 (permalink)  
Old 04-12-2006, 03:26 AM
New Pligger
 
Join Date: Apr 2006
Posts: 6
This is the database I think. From the MySQL docs:

Some words are ignored in full-text searches:

* Any word that is too short is ignored. The default minimum length of words that are found by full-text searches is four characters.
* Words in the stopword list are ignored. (...)
Reply With Quote
  #3 (permalink)  
Old 04-12-2006, 02:57 PM
Casual Pligger
 
Join Date: Feb 2006
Posts: 82
hmmm.. is there anyway around this?

Like marking a TAG "TAGGED-XXX" and then strip the "TAGGED-" with the results? That way everything should work?
Reply With Quote
  #4 (permalink)  
Old 04-12-2006, 03:51 PM
Constant Pligger
 
Join Date: Apr 2006
Posts: 100
Ah, I can verify this as well. I thought it was something to do with tags and multiple items ( http://www.pligg.com/forum/showthread.php?t=602 )

In looking at the SQL docs this looks to be an issue that requires too much for an admin to change.

Quote:
#

The minimum and maximum lengths of words to be indexed are defined by the ft_min_word_len and ft_max_word_len system variables. (See Section 5.2.2, “Server System Variables”.) The default minimum value is four characters; the default maximum is version dependent. If you change either value, you must rebuild your FULLTEXT indexes. For example, if you want three-character words to be searchable, you can set the ft_min_word_len variable by putting the following lines in an option file:

[mysqld]
ft_min_word_len=3

Then you must restart the server and rebuild your FULLTEXT indexes. Note particularly the remarks regarding myisamchk in the instructions following this list.
-- http://dev.mysql.com/doc/refman/5.0/...ne-tuning.html

The restarting the server deal is too much to ask and changing this would change it for an entire site. That's not going to work for people with other databases like forums and such.

So, a solution needs to come from the pligg developers in my opinion. This is a deal-breaker for me and I can't deploy a site with this bug. Three character tags are a must.

Last edited by DuckFat; 04-12-2006 at 04:07 PM.
Reply With Quote
  #5 (permalink)  
Old 04-12-2006, 05:14 PM
New Pligger
 
Join Date: Apr 2006
Posts: 4
Ah. I am glad others have found this bug and identified it. The user base for my deployed site will not take to having three letter tags non-functional. I think it would ring less-than-professional to have to place a "Please make all tags four letters or longer ie: men to mens. " on the submissions page Hopefully we can locate a fix. Pretty serious bug as it is.
Reply With Quote
  #6 (permalink)  
Old 04-12-2006, 05:31 PM
Constant Pligger
 
Join Date: Apr 2006
Posts: 100
Does anyone know if SQL variables can be changed through a script? I looked in PHPMyAdmin and it doesn't appear that you can change it--it just displays the settings.

If so, then would there be a way to rebuild the FULLTEXT indexes on just one database? We need a real SQL guru to chime in I guess... unless there is an easy fix that can be done in the app.
Reply With Quote
  #7 (permalink)  
Old 04-12-2006, 07:16 PM
New Pligger
 
Join Date: Apr 2006
Posts: 6
Duckfat: I don't think you can change it on the fly (I read that somewhere last night). Also, even if you can reconfigure MySQL, people say it isn't a good idea because of the way the fulltext search algorithm works.

I'm pretty sure the tag problem can be fixed by changing the sql query (I'll try to figure it out)... I don't know what to do about the search box though.
Reply With Quote
  #8 (permalink)  
Old 04-12-2006, 10:16 PM
New Pligger
 
Join Date: Apr 2006
Posts: 6
Here's a fix I just came up with...

In file index.php, right above the line:

$main_smarty = do_sidebar($main_smarty);

add,

if(!empty($_REQUEST['tag'])){
$mysearch = $_REQUEST['search'];
$from_where = "FROM links, tags WHERE tag_words='$mysearch' AND link_id=tag_link_id ORDER BY `link_votes` DESC ";
}


-----------------
It shouldn't break anything I can see, but someone might want to double check it. This fixes the tag cloud issue only, the search box still can't find requests < 4 chars.
Reply With Quote
  #9 (permalink)  
Old 04-12-2006, 10:26 PM
New Pligger
 
Join Date: Apr 2006
Posts: 6
Here's a little extra error checking (shouldn't matter but better safe then sorry).

Code:
if(!empty($_REQUEST['tag'])){
  if(!empty($_REQUEST['search'])){
    $mysearch = $_REQUEST['search'];
    $from_where = "FROM links, tags WHERE tag_words='$mysearch' AND link_id=tag_link_id ORDER BY `link_votes` DESC ";
  }
}
Reply With Quote
  #10 (permalink)  
Old 04-13-2006, 12:16 AM
Constant Pligger
 
Join Date: Apr 2006
Posts: 100
Good work! I'll implement this as soon as it's given the okey-dokey from the developers of Pligg. I don't want to patch now and have them come up with some other solution tomorrow. Knowing there is an easy fix really eases my mind abotu going ahead with the development of my new site. THANKS!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Some ideas to build a Pligg site Divisive Cotton Questions and Comments 22 10-22-2009 10:46 AM
Using Search Method 4 - Tags will not work hotsitez Questions and Comments 11 11-29-2008 07:54 PM
Search Method 3 and 4 in Pligg version 9.8.2 broke Iceburg Questions and Comments 3 11-03-2007 07:03 PM
cannot search 2 fields cruci Questions and Comments 1 11-15-2006 06:17 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development