Pligg CMS Forums


Go Back   Pligg CMS Forum > Pligg Development > Bug Report



Search Bug/Tag Bug

Found or fixed a small bug in Pligg? Post it here so we can update appropriately.


 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-10-2006, 11:33 PM
New Pligger
 
Join Date: Apr 2006
Posts: 4
Search Bug/Tag Bug

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.

Sponsor
  #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. (...)
  #3 (permalink)  
Old 04-12-2006, 02:57 PM
Casual Pligger
 
Join Date: Feb 2006
Posts: 94
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?
  #4 (permalink)  
Old 04-12-2006, 03:51 PM
Constant Pligger
 
Join Date: Apr 2006
Posts: 122
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.
  #5 (permalink)  
Old 04-12-2006, 05:14 PM
New Pligger
 
Join Date: Apr 2006
Posts: 4
three letters

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.
  #6 (permalink)  
Old 04-12-2006, 05:31 PM
Constant Pligger
 
Join Date: Apr 2006
Posts: 122
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.
  #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.
  #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.
  #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 ";
  }
}
  #10 (permalink)  
Old 04-13-2006, 12:16 AM
Constant Pligger
 
Join Date: Apr 2006
Posts: 122
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!
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
First Ever Meta-Community/Social Search Engine lodispoto My Pligg Site 0 12-23-2007 11:03 AM
SEO (Search Engine Optimization) GrinGEO Wiki Articles 24 12-02-2007 12:27 PM

Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Use the coupon code PLIGG at Dreamhost.com to receive a discount of up to $84.00 Make a donation to support Pligg CMS development