PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Mod Requests

Reply
 
Thread Tools
Old 12-08-2003, 04:00 AM   #1
renehaentjens
Orange Mole
 
Join Date: Nov 2003
Posts: 69
Points, underscores, ampersands and slashes

The PhpDig indexer (I'm using 1.6.5 now) considers words as composed of letters, digits, points, hyphens, underscores, ampersands and slashes.

But when it comes to searching, points, underscores, ampersands and slashes all of a sudden become word separators.

So when a page contains "xxx_yy", this 6-letter-word gets stored as keyword, but when I try to search for "xxx_yy", the search will be for "xxx" and "yy" is ignored as being too short. I can still find the page by searching for "xxx" with "words begin", but not for "xxx_yy" with "exact match".

Why?

(Words with hyphens index and search OK.)

(The documentation states, in "3.2": Words with underscores are included as well...)
__________________
René Haentjens, Ghent University
renehaentjens is offline   Reply With Quote
Old 12-08-2003, 02:00 PM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. In search_function.php of PhpDig 1.6.5 just add in those characters that you want to allow into the following line:
PHP Code:
$what_query_chars "[^".$phpdig_words_chars[PHPDIG_ENCODING]." -]+"
Remember to escape 'special' characters. For example, if you want to allow the _ character in searches, then change the above line to the following:
PHP Code:
$what_query_chars "[^".$phpdig_words_chars[PHPDIG_ENCODING]." \\_-]+"
__________________
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
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
phpdig add some underscores to URLs cjones Troubleshooting 10 12-13-2004 07:45 PM
regex for trailing slashes? leonardburton Coding & Tutorials 1 12-03-2004 04:06 AM


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


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