searching part of word using Full Text Index

  • Hi,

    I have a table with a column called description which stored product related information. The column has been included for full text search. This is :

    SELECT ...

    FROM ...

    WHERE CONTAINS ( *, @ftsQuery )

    where ftsQuery is the search string.

    It is working as expected. However, if a search is being made with part of a word - it's not returning the desired result.

    Example: I have a record with the description "personal computer backup"

    When the above query is executed with ftsQuery='backup' it's returning the record. However - if the search is made with ftsQuery='back' - it's not returning a row.

    Is there a way to modify the the way of indexing or query to make it work on both the cases?

    Thank you.

    [font="Comic Sans MS"]--
    Sabya[/font]

  • Any help on this guys ...

    [font="Comic Sans MS"]--
    Sabya[/font]

  • A few things to solve your problem. All are in the BOL.

    1. to search for plurals, word variants, etc. see FORMSOF and INFLECTION.

    http://technet.microsoft.com/en-us/library/ms142566(SQL.90).aspx

    Example:

    WHERE CONTAINS(curriculum_vite, 'FORMSOF (INFLECTIONAL, skate)')This matches curriculum_vite values that contain words such as 'skate', 'skates', 'skated', and 'skating'.

    2. To search for terms beginning with a string (wildcarding) see: http://technet.microsoft.com/en-us/library/ms142492(SQL.90).aspx

    Note that this is not a "put anywhere" wildcard. It can only be placed in specific locations and has side-effects when performing a phrase search. E.g., it will wildcard ALL of the terms.

    Also see the transform noise words option and what it does for phrase searches.

    http://technet.microsoft.com/en-us/library/ms187914(SQL.90).aspx

    And lastly, see Hilary Cotter's article at:

    http://www.simple-talk.com/sql/learn-sql-server/sql-server-full-text-search-language-features,-part-2/


    [font="Arial Narrow"](PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.[/font]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply