RE: [PHP] keyword searching

This is a discussion on RE: [PHP] keyword searching within the PHP General forums, part of the PHP Programming Forums category; [snip] I am selecting a field in a database called description for keyword searching. The field contains names of people, ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-12-2003
Jay Blanchard
 
Posts: n/a
Default RE: [PHP] keyword searching

[snip]
I am selecting a field in a database called description for keyword
searching. The field contains names of people, states, years, etc.
When
someone searches for say "holmes north carolina" the query searches for
exactly that, fields which have "holmes north carolina", and not fields
that contaim holmes, north, and carolina. So I run a str_replace to
replace all spaces with *, which turns it into "holmes*north*carolina",
but say that north carolina is before holmes in the field, it won't
return
those fields (it only returns fields in which holmes is infront of north

carolina). So how can I have it return all fields which contain all
the words holmes, north, and carolina in any order, in that field?
[/snip]

You don't say which database you are using, but several allow for full
text searching of fields where the order is inconsequential. The
behaviour you describe is preceisely how most (if not all) databases
will return a search on a "standard" column type.
Reply With Quote
  #2 (permalink)  
Old 11-12-2003
Adam Williams
 
Posts: n/a
Default Re: [PHP] keyword searching

I'm using Informix SQL. Do you know how to do full text searching on
Informix? If so, please share the details :)

Jay Blanchard wrote:

> [snip]
> I am selecting a field in a database called description for keyword
> searching. The field contains names of people, states, years, etc.
> When
> someone searches for say "holmes north carolina" the query searches for
> exactly that, fields which have "holmes north carolina", and not fields
> that contaim holmes, north, and carolina. So I run a str_replace to
> replace all spaces with *, which turns it into "holmes*north*carolina",
> but say that north carolina is before holmes in the field, it won't
> return
> those fields (it only returns fields in which holmes is infront of north
>
> carolina). So how can I have it return all fields which contain all
> the words holmes, north, and carolina in any order, in that field?
> [/snip]
>
> You don't say which database you are using, but several allow for full
> text searching of fields where the order is inconsequential. The
> behaviour you describe is preceisely how most (if not all) databases
> will return a search on a "standard" column type.
>

Reply With Quote
  #3 (permalink)  
Old 11-12-2003
Cpt John W. Holmes
 
Posts: n/a
Default Re: [PHP] keyword searching

From: "Adam Williams" <awilliam@mdah.state.ms.us>

> I'm using Informix SQL.


Could have saved some bandwidth by mentioning that in the first place and
only posting to either php-general or php-db (which is more appropriate),
not both. :)

Ignore what my other posts said, as I don't know how Informix works.

---John Holmes...
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:19 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0