Search Enhancement Mod

Started by ioszilla, August 12, 2007, 05:53:15 PM

Previous topic - Next topic

ioszilla

Go to your current theme folder, edit your language file (Modifications.english.php) and remove the above text. :)

Same problem was reported here: http://www.simplemachines.org/community/index.php?topic=188513.msg1222998#msg1222998, and I personally believe it's an SMF installer bug and is not related to this mod.

kamili34


kathylene

We have installed SMF 1.1.4 at http://www.projectjason.org/forums/index.php. [nofollow]

There seems to be a problem with the search topics only. If you go to the search page at http://www.projectjason.org/forums/index.php?action=search [nofollow]
and search the words       "lisa stebic"      and select "Search in topic subjects only", it comes back with no results. However, if you search those same words and don't select "Search in topic subjects only" it comes back with the correct result which is   http://www.projectjason.org/forums/index.php?topic=237.0 [nofollow] and the topic suject is "Missing Woman: Lisa Stebic - IL - 4/30/07" .

In the admin area for search
"Settings" -  all membergroups allowed to use the search function and enable simple search is not selected. Maximum results to show: 0


"Search Method"
Space used by forum messages in the database: 20330.63 KB
Space used to index messages in the database: 14483 KB
The search index is set to Fulltext index and it shows that it is already created. (I have removed it and then had it create it again also)
Both options, "Force the use of a search index: " and "Match whole words only:  " are deselected.

"Weights"
Relative search weight for number of matching messages within a topic (?):  30%
Relative search weight for age of last matching message (?):  25%
Relative search weight for topic length (?):  20%
Relative search weight for a matching subject (?):  15%
Relative search weight for a first message match (?):  10%
Relative search weight for a sticky topic (?):  0%
Total 100 100%
(I just left this at the default settings)
 



ioszilla

Hi kathylene,

Have u experienced  the same problem before the application of this mod? If so, there might be something wrong with your smf_log_search_subjects table (could be incomplete/corrupted). I encourage you to uninstall this mod and give it a try.

Also if possible, send me a copy of your modified Search.php. :)

ioszilla

I have just uploaded version 1.1.9 of this mod for SMF 1.1.4.

Changes:
1. A few tweaks to search parameters for better relevance ranking
2. Undo a change introduced to Search.php in SMF 1.1.4 that will break the apostrophe search ability offered by this mod.

saosangmo

hi wordzilla, could you add the function which limits number of seconds between 2 searching times?

ioszilla

Quote from: saosangmo on October 02, 2007, 02:27:24 PM
hi wordzilla, could you add the function which limits number of seconds between 2 searching times?

IMO you don't have to worry about search function overloading the server, as SMF search provides load average protection by default. :)

Normally user search requests won't proceed if server load average is deemed too high.

Merecraft

Hi wordzilla

I've installed the latest version (1.1.9) to my forum (1.1.4) but any searches containing an apostrophe just take me to a blank page with the message "Forbidden

You don't have permission to access /forum/index.php on this server."

Is that the expected behaviour? Thanks!

ioszilla

#108
Hi Merecraft,

No ofc it's *not* expected behavior. However I'm not able to reproduce the problem on my web forum (donationcoder.com) or on my local test forum (fresh SMF 1.1.4 installation).

Could you point me to your forum or send me a copy of your Search.php? Thx.

kathylene

Quote from: wordzilla on October 02, 2007, 01:40:04 PM
Hi kathylene,

Have u experienced  the same problem before the application of this mod? If so, there might be something wrong with your smf_log_search_subjects table (could be incomplete/corrupted). I encourage you to uninstall this mod and give it a try.

Also if possible, send me a copy of your modified Search.php. :)

I can't say for sure if we had problems prior to mod installation or not. I will uninstall and try search by topic subject, then reinstall and try to search by topic subject and let you know.

Am sending a copy of search.php

ioszilla

kathylene: I received an email from you a few hrs ago but it was totally blank. Could u resend the script to [email protected]:)

kathylene

Quote from: wordzilla on October 02, 2007, 01:40:04 PM
Hi kathylene,

Have u experienced  the same problem before the application of this mod? If so, there might be something wrong with your smf_log_search_subjects table (could be incomplete/corrupted). I encourage you to uninstall this mod and give it a try.

Also if possible, send me a copy of your modified Search.php. :)

Well, I removed the mod and still have the same problem. I looked at the smf_log_search_subjects in the db and that is the problem. We had imported the original threads from Deluxe Portal. The threads that were imported are the ones that are not listed in smf_log_search_subjects and therefor it is not returning any results when searched. All new posts though are being entered in smf_log_search_subjects so they are returning results.

Guess I will need to figure a way to pull the subjects from the imported posts into the smf_log_search_subjects.

Thanks for pointing me in the right direction to find problem.

kathylene

Quote from: kathylene on October 03, 2007, 11:33:59 AM
Quote from: wordzilla on October 02, 2007, 01:40:04 PM
Hi kathylene,

Have u experienced  the same problem before the application of this mod? If so, there might be something wrong with your smf_log_search_subjects table (could be incomplete/corrupted). I encourage you to uninstall this mod and give it a try.

Also if possible, send me a copy of your modified Search.php. :)

Well, I removed the mod and still have the same problem. I looked at the smf_log_search_subjects in the db and that is the problem. We had imported the original threads from Deluxe Portal. The threads that were imported are the ones that are not listed in smf_log_search_subjects and therefor it is not returning any results when searched. All new posts though are being entered in smf_log_search_subjects so they are returning results.

Guess I will need to figure a way to pull the subjects from the imported posts into the smf_log_search_subjects.

Thanks for pointing me in the right direction to find problem.

I exported my smf_topics (the id and subject) and will have to enter them into the smf_log_search_subjects. The only way I know how is to manually copy and paste each subject and remove  all the words except for one. 

Example make this
INSERT DELAYED IGNORE INTO `smf_log_search_subjects` VALUES (2, 'Grieving Mothers Become Anti-Abduction Crusaders');

into this
INSERT DELAYED IGNORE INTO `smf_log_search_subjects` (`ID_TOPIC`, `word`) VALUES (2, 'Grieving');
INSERT DELAYED IGNORE INTO `smf_log_search_subjects` (`ID_TOPIC`, `word`) VALUES (2, 'Mothers');
INSERT DELAYED IGNORE INTO `smf_log_search_subjects` (`ID_TOPIC`, `word`) VALUES (2, 'Become');
INSERT DELAYED IGNORE INTO `smf_log_search_subjects` (`ID_TOPIC`, `word`) VALUES (2, 'Anti-Abduction');
INSERT DELAYED IGNORE INTO `smf_log_search_subjects` (`ID_TOPIC`, `word`) VALUES (2, 'Crusaders');

this will then add all the imported info into smf_log_search_subjects.

thank you wordzilla for helping me with this.

ioszilla

No, u absolutely do not have to manually do it - that's a LOT of work! :P

1. Put your forum in maintenance mode (recommended but optional)
2. Go to your phpMyAdmin, EMPTY (*not* DROP) the table smf_log_search_subjects - just this table, no more no less.
3. Visit your forum, go to Admin -> Maintenance -> Forum Maintenance -> Find and repair any errors.

And then SMF will rebuild your smf_log_search_subjects table in minutes.

kathylene

Wordzilla,

My eyes, fingers and mind thank you. Yeah it is a long list and I think next week I would still be working on putting it in.

THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!

kathylene

Quote from: wordzilla on October 03, 2007, 02:42:33 PM
No, u absolutely do not have to manually do it - that's a LOT of work! :P

1. Put your forum in maintenance mode (recommended but optional)
2. Go to your phpMyAdmin, EMPTY (*not* DROP) the table smf_log_search_subjects - just this table, no more no less.
3. Visit your forum, go to Admin -> Maintenance -> Forum Maintenance -> Find and repair any errors.

And then SMF will rebuild your smf_log_search_subjects table in minutes.

you are a genious! thanks again!

dflora23

Hello!  I would love to add this mod but I'm getting the package manager error.  I read through your post on how to do a manual install but I've never done a manual install and am having trouble following the instructions.  I tried the Packager Parser site and I got lost in the code.

Is the only file I have to edit /search.php?  Can I use the package manager to install the rest and then edit that file?  Thanks for your time.  My forum members have been complaining about the lack of search functionality for some time.

Daniel
www.justlabradors.com/forum


ioszilla

Hi Daniel,

Quote from: dflora23 on October 04, 2007, 08:53:23 PM
Is the only file I have to edit /search.php?

No, there are at least 3 core files that you have to edit for this mod to work.

Quote from: dflora23 on October 04, 2007, 08:53:23 PM
Can I use the package manager to install the rest and then edit that file?  Thanks for your time.  My forum members have been complaining about the lack of search functionality for some time.

No, and don't proceed with installation if the mod fails the test (for any reason).

Could you tell me which file/files generated package manager errors? And if possible email me (admin at freethesaurus.net) the files in question so I can have a look.

If you have already installed other mods that may have made changes to Search.php, list them here. As this mod extensively modifies Search.php (around 60%), the installation is most likely to fail if Search.php has already been modified.

Merecraft

Hi wordzilla

just to let you know I emailed you a copy of my search.php file as requested. Let me know if you haven't received it :)

Thanks!

ioszilla

No I have not received it. :) Did u replace "at" with @?

Advertisement: