Results 1 to 4 of 4

Thread: text search

  1. #1
    Join Date
    Oct 2005
    Location
    SW England
    Posts
    102

    Unanswered: text search

    before I wade in and try to create a text search facility on my SQL server DB, can somebody point me in the right direction for a search ranking SQL query?

    I need the user to input two or three keywords into a search field and for the (small) DB to return a handful of rows in order of popularity of the keywords.

    I gather from my other post that I will need to be mindful of SQL injections but that's another issue.

    I just need some pointers at this stage.

    Thanks folks

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Define "popularity of the keywords".
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Oct 2005
    Location
    SW England
    Posts
    102
    My user has a 'wim wom slurping valve' so is looking for records containing the words 'wim' and/or 'wom' he will be most interested in records that contain either both words or a lot of references to wim or wom. the record with both words will be ranked above the record with only one word even if that record has lots of references to that word. A record with ten reference to wim will be ranked higher than a record with only five.
    This has been a basic requirement for text searches ever since searching was possible so I am assuming that SQL Server can do it natively, and I would like to know which method to follow. (I'm also assuming there are lots of ways to do it!) My user is stupid so ideally shouldn't be asked to choose 'and' or 'or'.

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Use the Full-Text search query engine, using the CONTAINS and FREETEXT sql functions.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •