question on searchplugin-how to search Keywords less 3 chars

Creating and modifying plugins.
Post Reply
wasabi
Regular
Posts: 10
Joined: Tue Apr 18, 2006 3:21 pm
Location: Augsburg, Germany

question on searchplugin-how to search Keywords less 3 chars

Post by wasabi »

Hello forum,

is there a way to make the search plugin find words and acronyms smaller than 3 characters?


I am using a serendipity blog at work where many people post their documentations with LOTS of acronyms. Searching an acronym with 3 chars, which is quite usual in IT, fails with the following message (in german):
Die Wörter Ihrer Suchanfrage müssen länger als 3 Zeichen sein...

Means more or less in English:

"the words in your search must be longer than 3 characters..."

Thank you in advance and kind regards,
Wasabi/Claudio
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: question on searchplugin-how to search Keywords less 3 c

Post by garvinhicking »

Hi!
is there a way to make the search plugin find words and acronyms smaller than 3 characters?
Sadly not easily, because s9y depends on the MySQL fulltextsearch which cannnot operate on words with less than 3 characters unless the MySQL server configuration is changed.

You might be able if you search for "acronym*" to get more hits?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
wasabi
Regular
Posts: 10
Joined: Tue Apr 18, 2006 3:21 pm
Location: Augsburg, Germany

Post by wasabi »

Hello Garvin
....unless the MySQL server configuration is changed
OK, the server configuration HAS changed via "ft_min_word_len=2"
the mysql-server is restarted, the indexes have been rebuilt, even our companie´s Intranet-apache has started over ;-)) but the problem persists :-(

Is there anything else I can do?

Thank you in advance for your answer,
Claudio
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
OK, the server configuration HAS changed via "ft_min_word_len=2"
the mysql-server is restarted, the indexes have been rebuilt, even our companie´s Intranet-apache has started over ;-)) but the problem persists :-(

Is there anything else I can do?
Yes, in fact you MUST patch the file include/genpage.inc.php and search for:

Code: Select all

if (strlen($serendipity['GET']['searchTerm']) <= 3) {
Sadly there is no easy way for a PHP script to fetch ft_min_word_len of the mysql server configuration without doing a lot of performanse intense querying of the full configuration.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
wasabi
Regular
Posts: 10
Joined: Tue Apr 18, 2006 3:21 pm
Location: Augsburg, Germany

Post by wasabi »

HTH,
Garvin
Yes indeed, that helped! Now we finally can search for e.g. tcp, udp, ftp, stp, vtp, bgp, etc. :lol:

Once again thank you very much for your fantastically fast & professional help!

Kind regards und Grüße nach Köln,
Wasabi/Claudio
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

No problem. Thanks for letting me know it now works! Have fun!

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply