Querying words instead of phrases

Discussion in 'Javascript' started by Cubicle Intern, Feb 29, 2008.

  1. Hi,

    My website's search function looks up entire phrases instead of
    individual words. For example, if I query "Google Groups," I would
    like my search to come up with everything in my database that has the
    words "Google" and "Groups," not just the phrase "Google Groups." I
    would want my search to bring back "Google-tastic Search" or "Group
    Compu-Google." Right now it only brings back "Google Groups #1,"
    "Google Group #2," etc.

    I'm at a loss at how to begin implementing this change. Any
    suggestions? I'm working with ASP files, Javascript and HTML. Thanks
    in advance for any help.

    tyv
    Cubicle Intern, Feb 29, 2008
    #1
    1. Advertising

  2. Cubicle Intern

    Guest

    On Feb 29, 12:58 pm, Cubicle Intern <> wrote:
    > Hi,
    >
    > My website's search function looks up entire phrases instead of
    > individual words. For example, if I query "Google Groups," I would
    > like my search to come up with everything in my database that has the
    > words "Google" and "Groups," not just the phrase "Google Groups." I
    > would want my search to bring back "Google-tastic Search" or "Group
    > Compu-Google." Right now it only brings back "Google Groups #1,"
    > "Google Group #2," etc.
    >
    > I'm at a loss at how to begin implementing this change. Any
    > suggestions? I'm working with ASP files, Javascript and HTML. Thanks
    > in advance for any help.
    >
    > tyv


    You could split the search phrase by spaces, then query each word
    individually. Then, merge the lists in such a way that items that
    appear in both lists appear at the top of your results page.
    , Feb 29, 2008
    #2
    1. Advertising

  3. Cubicle Intern

    Tom de Neef Guest

    "Cubicle Intern" <> schreef
    > Hi,
    >
    > My website's search function looks up entire phrases instead of
    > individual words. For example, if I query "Google Groups," I would
    > like my search to come up with everything in my database that has the
    > words "Google" and "Groups," not just the phrase "Google Groups." I
    > would want my search to bring back "Google-tastic Search" or "Group
    > Compu-Google." Right now it only brings back "Google Groups #1,"
    > "Google Group #2," etc.
    >
    > I'm at a loss at how to begin implementing this change. Any
    > suggestions? I'm working with ASP files, Javascript and HTML. Thanks
    > in advance for any help.
    >


    If you want to display only those results that match all words in the search
    text, you would proceed as follows:
    search the database for all matches on the first word
    search the results for all matches on the second word
    etc

    In pseudo code:
    resultList = match(database,words[0])
    n = 1
    while (n<words.length) { resultList = match(resultList,words[n]); n++ }

    Tom
    Tom de Neef, Feb 29, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    Does a resource have to have all phrases in it?

    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Jan 30, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    374
    Neil Ni
    Feb 3, 2006
  2. Cubicle Intern

    Querying multiple words

    Cubicle Intern, Feb 29, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    277
    Peter Bromberg [C# MVP]
    Feb 29, 2008
  3. Dan Fitzpatrick
    Replies:
    9
    Views:
    197
    Gavin Kistner
    May 28, 2005
  4. Robert Oschler
    Replies:
    2
    Views:
    112
    peterS.
    Aug 2, 2005
  5. Replies:
    0
    Views:
    133
Loading...

Share This Page