Querying words instead of phrases

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cubicle Intern

    Querying words instead of phrases

    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
  • endangeredmassa@gmail.com

    #2
    Re: Querying words instead of phrases

    On Feb 29, 12:58 pm, Cubicle Intern <vyts...@gmail. comwrote:
    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.

    Comment

    • Tom de Neef

      #3
      Re: Querying words instead of phrases

      "Cubicle Intern" <vytsang@gmail. comschreef
      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(resultLis t,words[n]); n++ }

      Tom


      Comment

      Working...