PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   How-to Forum (http://www.phpdig.net/forum/forumdisplay.php?f=33)
-   -   Directory structures appear as one word (http://www.phpdig.net/forum/showthread.php?t=200)

Big_ben 11-08-2003 05:09 AM

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));

Charter 11-08-2003 09:10 AM

Hi. Instead, perhaps try the following and then crawl a demo page.

In robot_functions.php find:
PHP Code:

$separators " "

and replace with:
PHP Code:

$separators " /"


Big_ben 11-08-2003 10:21 AM

Yeah that seemed to do the trick. Thanks alot!


All times are GMT -8. The time now is 12:41 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.