View Full Version : Directory structures appear as one word

11-08-2003, 05:09 AM
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:.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.
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));

11-08-2003, 09:10 AM
Hi. Instead, perhaps try the following and then crawl a demo page.

In robot_functions.php find:

$separators = " ";

and replace with:

$separators = " /";

11-08-2003, 10:21 AM
Yeah that seemed to do the trick. Thanks alot!