BUG: search terms smaller than minimum word length cause search to return no results

"Jason Bodnar" <[email protected]>
Newsgroups gmane.comp.web.perlfect-search
Message-ID <[email protected]>
I had the minimum word length set to the default -- 3. If I searched for the
term "Dr. Bill" (no quotes) with match all I got no results. The term "Dr" was
not being found because it's not indexed due to being only two characters. If
I changed the min word length to 2 and reindexed then "Dr. Bill" returned results.

I think the search script should skip terms shorter than the minimum word
length. In search.pl, in the create_query sub, the line:

my @terms = split " ", $query_str;

should be changed to something like:

my @terms = grep($_ if length $_ >= $MIN_WORD_LENGTH, split " ", $query_str);

replacing $MIN_WORD_LENGTH with the variable that actually holds the min word
length from the conf.pl file.

--
Jason Bodnar
[email protected]
http://www.shakabuku.org

_______________________________________________
perlfect-search mailing list
[email protected]
To unsubscribe, set other personal options or view the list archives please visit:
http://perlfect.com/mailman/listinfo/perlfect-search

lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.