Hi. The punctuation is on there for exact matches, but perhaps this exact match is too exact.
To relax the exact match and drop a lot, but not all, of the punctuation from the end of a word, do the following.
In phpdig_functions.php find:
Code:
$text = ereg_replace('[^'.$phpdig_words_chars[$enco
ding].' \\'._~@#$:&%/;,=-]+',' ',$text);
and afterwards add:
Code:
$text = ereg_replace('(['.$phpdig_words_chars[$enco
ding].'])[\\'._~@#$:&%/;,=-]+($|[[:space:]]$|[[:spa
ce:]]['.$phpdig_words_chars[$encoding].'])','\1\2',$text);
In search_function.php find:
Code:
if (eregi($what_query_chars,$query_to_parse)) {
$query_to_parse = eregi_replace($what_que
ry_chars," ",$query_to_parse);
}
and afterwards add:
Code:
$query_to_parse = ereg_replace('(['.$phpdig_words_chars[PHPDIG_EN
CODING].'])[\\'.\_~@#$:&\%/;,=-]+($|[[:space:]]$|[[:space:]]['.$ph
pdig_words_chars[PHPDIG_ENCODING].'])','\1\2',$query_to_parse);
In search_function.php find:
Code:
if ($option == "exact") { // there are two instances of this
In both of these two if statements find:
Code:
$reg_strings = str_replace('@#@',' ',phpdigPregQuotes(str_repl
ace('\\\','',implode('@#@', $query_for_phrase_array))));
and replace with:
Code:
$reg_strings = str_replace('@#@','.* ',phpdigPregQuotes(str_repl
ace('\\\','',implode('@#@', $query_for_phrase_array))));
For breaking on a / or - character, see
this thread. To exclude certain numbers, add a regex to the following line in robot_functions.php:
Code:
if (strlen($key) > SMALL_WORDS_SIZE and strlen($key) <= MAX_WOR
DS_SIZE and !isset($common_words[$key]) and ereg('^['.$phpdig_wo
rds_chars[PHPDIG_ENCODING].'#$]',$key))
For the changes to take effect, a new index would need to be done. Remember to remove any "word" wrapping from the above code.