|
09-28-2004, 06:03 AM | #1 |
Green Mole
Join Date: Jan 2004
Posts: 2
|
"Did you mean" behavior
Sorry, just wrote a long post and was given the login prompt again when hit post, so I'll be briefer on this one.
I'm testing v1.8.3 at http://****verma.gov/dig/ (the one in the title bar goes to an earlier version, so you'll need to use that url). When I search for 'board of assessors', v1.8.3 returns results correctly after ignoring of and using the default AND operator. But if I intentionally mispell a word, as in "board of assesors", it recommends "bird assessors". I'd recommend a better way would be to only offer replacements for words each individual word does not produce results. Long story short, 'bird' shouldn't have been offered. By the way, 'did', 'you' and 'mean' are all ignored words on the forum search, so I apologize if there is another thread that talks about this. Thanks! Mike |
09-28-2004, 11:50 PM | #2 |
Orange Mole
Join Date: Nov 2003
Posts: 69
|
China
PhpDig 1.8.3 mimics the Big-Brother-like attitude of Google, telling the user to try another keyword if it didn't find anything, often giving silly or irritating suggestions, at least in my opinion.
I have a showcase on aquaculture (fish & seafood production) and searched for keywords "feed-production" and "scheme". As PhpDig didn't find anything, it told me: No results. Did you mean china? Can I change the way in which PhpDig comes up with a new suggestion, to enhance it for my environment? If not, or if difficult, can I switch it off?
__________________
René Haentjens, Ghent University |
10-17-2004, 02:07 PM | #3 |
Green Mole
Join Date: Oct 2004
Posts: 1
|
I noticed the "Did you mean" feature was related to a value called "alt_try". The file "libs/search_function.php" contains the "alt_try" value in a function on line 629. That line is simply appending text to the result message. I commented out the line, and the "Did you mean" no longer displays.
Here is line 629 (commented out). //$result_message .= ". " . phpdigMsg('alt_try') ." <a class=\"phpdigMessage\" href=\"".SEARCH_PAGE."?page=search&template_demo=".$_GET['template_demo']."& query_string=".urlencode($leven_query)."\"><i>".htmlspecialchars($leven_que ry)."</i></a>?"; |
10-28-2004, 05:05 AM | #4 |
Orange Mole
Join Date: Nov 2003
Posts: 69
|
Thank you jabdulla!
I looked at the code just above, then at the PHP and MySQL documentation, and learned something about soundex (PHP and MySQL, but different), the importance of adding a letter in front (e.g. Q), levenshtein, metaphone and other strange animals. As my keywords are arranged in a tree, thesaurus-like, I might suggest the user to search with a broader term (e.g. "flatfish", in case a search on "sole" did not return any results) rather than a sound-alike ("shark" instead of "carp"?). Also, the user clicks in the keyword tree, which means that misspellings (MESSING PILLS? SMELL PIG SINS? MINGLES SLIPS?) do not occur all that often (no need for ELEVENTH SIN). harsh reality... http://www.wordsmith.org/anagram/index.html
__________________
René Haentjens, Ghent University |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
search.php suddenly stops parsing during "extract vars" | jackmoring | Troubleshooting | 1 | 08-25-2006 12:27 PM |
shows blank page if "Search All" and "exact phrase", timeout? | alokjain9 | Troubleshooting | 2 | 03-07-2006 08:08 AM |
"search depth" and "links per" features | laurentxav | How-to Forum | 1 | 01-12-2005 08:27 PM |
Command line spider ignoring "filelist.txt" | lighthouse | Troubleshooting | 9 | 08-18-2004 08:35 AM |