SQL 2005, full-text search

Last post 07-09-2009 3:18 AM by Jian Kang - MSFT. 1 replies.

Sort Posts:

  • SQL 2005, full-text search

    07-06-2009, 6:59 AM
    • Member
      point Member
    • looc
    • Member since 05-22-2007, 10:03 AM
    • Posts 2

     Hi

    Question about full-text search, i have set up a table with two collumns, title and body

    I have added a full-text to include both columns.

    Now i want to search "google"-style in both columns but i cant get a hit from both at the same querie.

    The table include a post: title=abc123, body = xyz987

    select title from table where contains((title,body), 'abc123 and xyz987') is not working

    select title from table where contains((title,body), 'abc123) is working and

    select title from table where contains((title,body), 'xyz987') is working

    How can i get FT to return hits from two different columns?

     

    /bjorn

     

  • Re: SQL 2005, full-text search

    07-09-2009, 3:18 AM
    Answer

    looc:

    select title from table where contains((title,body), 'abc123 and xyz987') is not working 

    select title from table where contains((title,body), 'abc123) is working and

    select title from table where contains((title,body), 'xyz987') is working

     

    Hi looc,

    I think we should change the query to:

    select title from table where contains((title,body), ' “abc123” and “xyz987” ')


    Please refer to the following links for more detail:

    CONTAINS (Transact-SQL)
    http://msdn.microsoft.com/en-us/library/ms187787.aspx

    Enabling Full-Text Search in your Text Data
    http://www.asp.net/learn/sql-videos/video-115.aspx

    Jian Kang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (2 items)