Perlfect Solutions
 

[Perlfect-search] Using "&" as the search text

Daniel Naber daniel.naber@t-online.de
Thu, 27 Sep 2001 21:47:57 +0200
On Thursday 27 September 2001 08:59, you wrote:

> But I have some documents which has the "&" sign inside, say "A&C". When
> I type "A&C" in the search field, it return nothing and the query string
> is now changed to "A  C".

You'll have to make several changes to allow & (that is & in 
documents):

1. Add & and ; to this line $buffer =~ tr/a-zA-Z0-9_*/ /cs; in both 
search.pl and indexer.pl, i.e.
$buffer =~ tr/a-zA-Z0-9_*&;/ /cs;

2. Just below that line, add ${$buffer} =~ s/&/&/igs; in indexer.pl

3. Remove the & from search.pl's cleanup() function

I think this way every special character that's represented as an entity 
in the documents and that's added in step 2. can be searched.

Regards
 Daniel

-- 
Daniel Naber, Paul-Gerhardt-Str. 2, 33332 Guetersloh, Germany
http://www.danielnaber.de