customized English word breaker for sql server 2008

本文介绍如何在SQL Server中创建自定义的WordBreaker和Stemmer,包括修改注册表键值、复制必要的DLL文件及配置自定义词法分析规则。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. Open the Registry Editor, by:
    1. Clicking Start, and clicking Run.
    2. In the Run dialog box, in the Open box, type Regedit.
  2. In Registry Editor, select the following registry key for the first instance of SQL Server: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSearch\CLSID  (Please replace the MSSQLSERVER with the real instance name if it's named instance)
  3. On the menu bar, click Edit, click New, and click Key.
  4. Type {9DAA54E8-CD95-4107-8E7F-BA3F24732D95}.
  5. Press ENTER.
  6. In the right pane, right-click the Default registry value, and then click Modify.
  7. In the Edit String dialog box, in the Value data box, type NaturalLanguage6.dll, and then click OK.

  8. In Registry Editor, select the following registry key for the first instance of SQL Server:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSearch\Language\enu
  9. Replace the 'WbreakerClass'  and 'StemmerClass'with new value as below

    WBreakerClass:{9DAA54E8-CD95-4107-8E7F-BA3F24732D95}

    StemmerClass :{61A48126-EF74-4d4a-9DDA-43FD542CAD1E}

  10. Copy files:

       

       

       

    from    "C:\Windows\System32"

       

    to      "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn"

       

       

       

    NlsData0009.dll

       

    NlsLexicons0009.dll

       

    Now , we are going to create our own customized word breaker

    1. Log on to sql server box under window administrator account
    2. Open a notepad
    3. Put below words following the rule list in article http://technet.microsoft.com/en-us/library/cc263242.aspx#Rules

      red/bl

      -st/fl

      red/

      24-

         

    4. On the File menu, click Save As.
    5. In the Save as type list, select All Files.
    6. In the Encoding list, select Unicode.
    7. In the File name box, type the file name in the following format: Custom0009.lex,  (Please do not change the file name)
    8. put the file to the sql server instance binn folder , for example :  C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn.
    9. Restart fdhost by executing "exec sp_fulltext_service 'restart_all_fdhosts'" on the sql server instance.
    10. Now the customized word breaker works, here is a screenshot of test:

       

       

    Please note, before we configure the word break , the result is as below

    select *From sys.dm_fts_parser('red/bl',1033,0,0)

       

转载于:https://www.cnblogs.com/stswordman/p/3432633.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值