FULL TEXT SEARCH question...

  • Hi,

    I've a table with values that have the '-' char, ex:LO-AS-1.

    I'm trying to search the table for that value but it returns more records since it breaks the search term into several others:

    SELECT * FROM sys.dm_fts_parser ('"LO-AS-1"', 2070, 0, 0) returns:

    lo-as-1

    lo

    as - noise word

    1 - noise word

    nn1 - noise word

    Is there anyway of searching for the exact word? With LIKE it works fine but it's very slow....

    Thanks,

    Pedro



    If you need to work better, try working less...

  • PiMané (4/8/2015)


    Hi,

    I've a table with values that have the '-' char, ex:LO-AS-1.

    I'm trying to search the table for that value but it returns more records since it breaks the search term into several others:

    SELECT * FROM sys.dm_fts_parser ('"LO-AS-1"', 2070, 0, 0) returns:

    lo-as-1

    lo

    as - noise word

    1 - noise word

    nn1 - noise word

    Is there anyway of searching for the exact word? With LIKE it works fine but it's very slow....

    Thanks,

    Pedro

    Quick suggestion, use CONTAINS (Transact-SQL) or CONTAINSTABLE (Transact-SQL)

    😎

  • Eirikur Eiriksson (4/12/2015)


    PiMané (4/8/2015)


    Hi,

    I've a table with values that have the '-' char, ex:LO-AS-1.

    I'm trying to search the table for that value but it returns more records since it breaks the search term into several others:

    SELECT * FROM sys.dm_fts_parser ('"LO-AS-1"', 2070, 0, 0) returns:

    lo-as-1

    lo

    as - noise word

    1 - noise word

    nn1 - noise word

    Is there anyway of searching for the exact word? With LIKE it works fine but it's very slow....

    Thanks,

    Pedro

    Quick suggestion, use CONTAINS (Transact-SQL) or CONTAINSTABLE (Transact-SQL)

    😎

    The CONTAINS and CONTAINSTABLE use the search terms returns by sys.dm_fts_parser.. It will search for the complete word and for the terms separated by -.

    I want SQL not to consider the - a word breaker..

    Pedro



    If you need to work better, try working less...

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

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