PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > How-to Forum

Reply
 
Thread Tools
Old 01-19-2004, 07:40 AM   #1
vinyl-junkie
Purple Mole
 
Join Date: Jan 2004
Posts: 694
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!

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.
vinyl-junkie is offline   Reply With Quote
Old 01-19-2004, 08:08 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
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.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 01-19-2004, 12:08 PM   #3
vinyl-junkie
Purple Mole
 
Join Date: Jan 2004
Posts: 694
Worked like a charm! Thanks very much for your help.
vinyl-junkie is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Index only XXX character... PL_90 How-to Forum 0 10-05-2007 12:28 PM
Plus character(+) converted to (%20) in urls raymerica Troubleshooting 2 05-31-2006 01:19 PM
Is this a character encoding problem ? casimiro Troubleshooting 0 12-22-2005 08:39 AM
index all words Dreamory How-to Forum 0 10-22-2004 06:34 AM
Cyrillic character in the URL !? wertas Troubleshooting 1 02-16-2004 02:09 PM


All times are GMT -8. The time now is 05:30 AM.


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