SQL Server 2008 R2 full text search using FORMSOF and Accent

I am using MS SQL Server 2008 R2 with full-text search to search for text data stored in different languages.

I'm a little confused about how the CONTAINS predicate works with accents.

When I use the following predicate

 CONTAINS([Text], @keywords , Language @language) 

in a directory with ACCENT_SENSITIVITY = OFF the search results are the same for, for example, “Lächeln” and “lacheln” when Germany is specified as the language.

But if I change the predicate to look like

 CONTAINS([Text], FORMSOF(INFLECTIONAL, @keywords) , Language @language) 

then the results are different, and it seems to me that Accent Insensitivity does not work with FORMSOF

I tried to find the answer on MSDN and Google, but did not find anything useful.

Does anyone know why the results are different?

Thanks!

+4
source share
2 answers

I understand that they serve two different purposes in finding matches for full-text searches. In a catalog with an asymmetric accent, there is a simple uniform equality that holds for a term that matches eñya = enya, because "n" is considered an accent, an insensitive equivalent to "ñ".

Using FORMSOF, you request that the search perform an operation in terms, so that the forms of verbs and names are found as additional conditions in the search. for example, a search for “legs” will include “legs,” and “running” will include “running.”

If FORMSOF does not seem to work fundamentally for your values, you might want to make sure that you have the appropriate language support installed for full-text languages. SELECT * FROM sys.fulltext_languages

If you have not been able to view MSDN, the SQL Word Breakers documentation may shed light on the observed behavior. http://msdn.microsoft.com/en-us/library/ms142509.aspx

0
source

FORMSOF cuts diacritics from your word:

 SELECT * FROM sys.dm_fts_parser(N'FORMSOF(INFLECTIONAL, "Lächeln")', 1031, 0, 1) 

check the column "display_term".

0
source

Source: https://habr.com/ru/post/1347754/


All Articles