Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Searching for Numbers

Quote Reply
Searching for Numbers
I'm using LinksSQL for an online book store. I need the search feature to be able to searh by the book's ISBN number. I've got the ISBN field weighted, but it seems the search results always return something like: "0442014082 - Phone number" (and returns no results) when trying to search by a string of numbers. Is there anyway around this?
Quote Reply
Re: Searching for Numbers In reply to
in search.pm (in the Links directory)

Code:
# ... not a phone number
if ($querant =~ /^[\d\-]+$/)
{ push @reject, [ $querant, $dr{PHONENUMBER} ]; next }

that seeks out whether it's just a sring of numbers. If you ## that out, you'll probably be allowed to get past that.

To be elegant, you should really use the validity test for an ISBN number (isn't it divisible by 17?) and if it is, call it an ISBN number, and search on that field only, and if it's not, call it a phone number or other arbitrary string of numbers and reject it.

Quote Reply
Re: Searching for Numbers In reply to
Did this work???

Quote Reply
Re: Searching for Numbers In reply to
It worked great! Thank you for your help.