If you're looking at a PHP only solution, then you've got to build an
engine that'll parse the search text, i.e. separate the quoted areas,
the +words, -words, etc and form that into a usable SQL query. As for
the table you search, using LIKE would be horribly slow on a large
table, so you'll probably have to build a "keyword" table and relate
each keyword back to the original table it was in. Then you'd search on
It would probably be better and faster to use a database solution, i.e.
fulltext indexing in MySQL. It already supports searching with +word and
-word, not sure about quotes, though. I'm sure other databases have
their own method of doing this and I'm sure it would be faster overall
because the database knows where everything is at and you don't have to
build a "keyword" table.
> -----Original Message-----
> From: Adam Royle [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 09, 2002 6:54 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Advanced search scripts
> Well, for this example, you could use mySQL, but really, I would be
> looking to utilise this on any database. Personally, I don't think
> would be database dependent (unless you have other ideas).
> On Wednesday, October 9, 2002, at 08:46 PM, John W. Holmes wrote:
> > What database are you using?
> > ---John Holmes...
> >> -----Original Message-----
> >> From: Adam Royle [mailto:[EMAIL PROTECTED]]
> >> Sent: Wednesday, October 09, 2002 2:09 AM
> >> To: [EMAIL PROTECTED]
> >> Subject: [PHP-DB] Advanced search scripts
> >> I was wondering if anyone has some resources (links or scripts) on
> >> 'advanced site searches'. Something that is similar to the way
> >> search engines process requests.
> >> ie. "phrase or two" word +required -"not included"
> >> Also, returning details of that search, say for example returning
> > words
> >> before and 10 words after and displaying it in search results. The
> > ability
> >> to search similar words (eg. ignoring punctuation) would be cool
> > aswell.
> >> I am interested in this for database (all text fields), and also
> > searching
> >> text files on filesystem.
> >> Now, I'm not trying to recreate Google or anything, and this is
> > for
> >> my own research (at this time), but I eventually would like to be
> > to
> >> create a smarter site searching engine.
> >> Can anyone give suggestions? or any links to tutorials (or books)
> >> I have used regex a little bit before, but not in PHP (only ASP and
> >> Adam
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php