View Single Post
Old 11-08-2003, 05:09 AM   #1
Big_ben
Green Mole
 
Join Date: Nov 2003
Location: lübeck, Germany
Posts: 3
Question Directory structures appear as one word

Hi,
I am new here and this is my first post. I am planning on using phpdig for a search engine in my LAN, in order to find shared files and webpages. My problem is that in filenames like:.
Quote:
Download/Games/Battlefield_1942_Desert_Combat_Mod/battlefield_1942_patch_v1.3.exe
are found as one keyword. I was able to find these by changing the max_keyword_length variable, but what i would really like, is that when a / comes to define that as end of the word, and or signal that a new word is coming. Then in the above example would change to 4 keywords. I'm guessing that I need to change the following lines, but since php is somewhat new to me, I am not sure what I need to add.
Quote:
libs/php_functions.php (line 223)

$text = ereg_replace('[[:blank:]][0-9]+[[:blank:]]',' ',ereg_replace('[^'.$phpdig_words_chars[$encoding].'._&%/-]+',' ',$text));
$text = ereg_replace('[[:blank:]][^ ]{1,'.$min_word_length.'}[[:blank:]]',' ',' '.$text.' ');
$text = ereg_replace('\.+[[:blank:]]|\.+$|\.{2,}',' ',$text);
return trim(ereg_replace("[[:blank:]]+"," ",$text));
Big_ben is offline   Reply With Quote