I have a search form that searches multiple fields in a db.
Currently, if you enter "nike putter" it only returns records that
have "nike putter" as a connected phrase. How do I get the db to
return records that have "nike" or "putter" in say the Title field and/
or "nike" or "putter" in the Description field?
So, if a record has a Title with "putter" and a description with the
word "Nike", what needs to be done either with the SQL code or the SQL
server configuration to return the record if a search enters "Nike
Putter"?
Thanks.
BrettHi
try some thing like this
select * from table where Title like '%nike%putter' or Description like
'%nike%putter'
Regards
VT
Knowledge is power, share it...
http://oneplace4sql.blogspot.com/
"Brett_A" <brettatkin@.gmail.com> wrote in message
news:1181046816.006183.220600@.q66g2000hsg.googlegroups.com...
>I have a search form that searches multiple fields in a db.
> Currently, if you enter "nike putter" it only returns records that
> have "nike putter" as a connected phrase. How do I get the db to
> return records that have "nike" or "putter" in say the Title field and/
> or "nike" or "putter" in the Description field?
> So, if a record has a Title with "putter" and a description with the
> word "Nike", what needs to be done either with the SQL code or the SQL
> server configuration to return the record if a search enters "Nike
> Putter"?
> Thanks.
> Brett
>|||Brett
Perhaps you need to consider ful-text search to enable on the database.
"Brett_A" <brettatkin@.gmail.com> wrote in message
news:1181046816.006183.220600@.q66g2000hsg.googlegroups.com...
>I have a search form that searches multiple fields in a db.
> Currently, if you enter "nike putter" it only returns records that
> have "nike putter" as a connected phrase. How do I get the db to
> return records that have "nike" or "putter" in say the Title field and/
> or "nike" or "putter" in the Description field?
> So, if a record has a Title with "putter" and a description with the
> word "Nike", what needs to be done either with the SQL code or the SQL
> server configuration to return the record if a search enters "Nike
> Putter"?
> Thanks.
> Brett
>|||Thanks for the quick reply but I have no way of knowing how the
searcher will enter the phrase. They may enter "putter nike titleist"
as a search phrase.
So maybe my question should be how to search the db for each
individual word used in the search term.
Brett
On Jun 5, 8:46 am, "vt" <vinu.t.1...@.gmail.com> wrote:
> Hi
> try some thing like this
> select * from table where Title like '%nike%putter' or Description like
> '%nike%putter'
> Regards
> VT
> Knowledge is power, share it...http://oneplace4sql.blogspot.com/"Brett_A" <brettat...@.gmail.com> wrote in message
> news:1181046816.006183.220600@.q66g2000hsg.googlegroups.com...
> >I have a search form that searches multiple fields in a db.
> > Currently, if you enter "nike putter" it only returns records that
> > have "nike putter" as a connected phrase. How do I get the db to
> > return records that have "nike" or "putter" in say the Title field and/
> > or "nike" or "putter" in the Description field?
> > So, if a record has a Title with "putter" and a description with the
> > word "Nike", what needs to be done either with the SQL code or the SQL
> > server configuration to return the record if a search enters "Nike
> > Putter"?
> > Thanks.
> > Brett
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment