PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   How-to Forum (http://www.phpdig.net/forum/forumdisplay.php?f=33)
-   -   How To Index One-Character Words (http://www.phpdig.net/forum/showthread.php?t=413)

vinyl-junkie 01-19-2004 06:40 AM

How To Index One-Character Words
 
I just started using phpDig last night. Looks like I've finally found a decent website search engine that I can live with! :D

I'm wondering though how I can set it up so that even single character words are indexed. I found the following statement in the config.php file, which I think would govern that.
Code:

define('SMALL_WORDS_SIZE',2);
When I set that number to zero, it sure didn't like that. Is there any way to disable the small words exclusion? Thanks in advance for your help.

Charter 01-19-2004 07:08 AM

Hi. Not tested, but perhaps try the following.

Comment out the following line in the phpdigEpureText function located in the phpdig_functions.php file:
PHP Code:

$text ereg_replace('[[:blank:]][^ ]{1,'.$min_word_length.'}[[:blank:]]',' ',' '.$text.' '); 

Also comment out the following chunk of code in the search_function.php file:
PHP Code:

while (ereg(' ([^ ]{1,'.SMALL_WORDS_SIZE.'}) | ([^ ]{1,'.SMALL_WORDS_SIZE.'})$|^([^ ]{1,'.SMALL_WORDS_SIZE.'}) ',$test_short,$regs)) {
     for (
$n=1$n <=3$n++) {
        if (
$regs[$n]) {
            
$ignore .= "\"".$regs[$n]."\", ";
            
$test_short trim(str_replace($regs[$n],"",$test_short));
        }
     }


Then set define('SMALL_WORDS_SIZE',2); to define('SMALL_WORDS_SIZE',0); in the config file.

vinyl-junkie 01-19-2004 11:08 AM

Worked like a charm! Thanks very much for your help. :)


All times are GMT -8. The time now is 08:53 PM.

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