none
Fulltext index and nn prefix for numbers RRS feed

  • Frage

  • Hi,

    I have a question for the word breaking within fulltext search (SQL Server 2008 R2). Is it possible to deactivate the word breaking of numbers in a nvarchar field to a term with leading nn?
    Example: A table with col1 nvarchar(50) has two rows, "007 James Bond" and "7 Zwerge".

    When I search for 007* I found both rows:
    select * from test.dbo.tab1 where contains(col1, '"007*"',LANGUAGE 1031)

    Check the content of fulltext index with
    SELECT * FROM sys.dm_fts_index_keywords_by_document(DB_ID(), OBJECT_ID('tab1'))
    show me the entries

    keyword   display_term column_id document_id occurrence_count
    0x003000300037   007 1  1  1
    0x0037    7 1  2  1
    0x0062006F006E0064  bond 1  1  1
    0x006A0061006D00650073  james 1  1  1
    0x006E006E0037   nn7 1  1  1
    0x006E006E0037   nn7 1  2  1
    0x007A00770065007200670065 zwerge 1  2  1

    Why SQL Server create the term nn7 with the prefix nn?
    Next problem:
    A search for n* (Show me all rows beginning with n)
    select * from test.dbo.tab1 where contains(col1, '"n*"',LANGUAGE 1031)

    find both rows, but "7 Zwerge" does not have a "n".

    Some ideas?

    regards,
    Alex

    Dienstag, 8. November 2011 09:53