【问题标题】:What would prevent records from being added to a Full Text index?什么会阻止记录被添加到全文索引?
【发布时间】:2017-03-23 22:02:42
【问题描述】:

我遇到了一个问题,即对我知道存在的记录进行全文搜索时没有得到任何结果。删除索引并重新创建它解决了问题,这让我认为记录没有添加到索引中。是什么原因造成的?

这是在我们的 QA 环境中,我们偶尔会从生产备份中恢复此环境。会不会造成这种情况? 编辑我刚刚在生产环境中运行了相同的查询,全文索引在那里返回了正确的结果,所以我不确定从生产环境中恢复是否会成为问题。

【问题讨论】:

    标签: sql-server sql-server-2008-r2 full-text-search


    【解决方案1】:

    根据您的问题,我想说未添加新记录的最可能原因是基于全文索引填充方式的配置。在 SQL Server 2008 R2 中,全文索引基于计划作业进行更新,而不是像其他索引那样在插入/更新时动态更新。要检查的问题:

    另外,来自在线图书,在CREATE FULLTEXT INDEX (Transact-SQL) 部分:

    CHANGE_TRACKING [ = ] { MANUAL | AUTO | OFF [ , NO POPULATION ] }
    Specifies whether changes (updates, deletes or inserts) made to table columns that are 
    covered by the full-text index will be propagated by SQL Server to the full-text index. 
    Data changes through WRITETEXT and UPDATETEXT are not reflected in the full-text index, 
    and are not picked up with change tracking. 
    
    
    MANUAL 
        Specifies that the tracked changes must be propagated manually by calling the 
        ALTER FULLTEXT INDEX … START UPDATE POPULATION Transact-SQL statement (manual 
        population). You can use SQL Server Agent to call this Transact-SQL statement 
        periodically. 
    
    AUTO
        Specifies that the tracked changes will be propagated automatically as data is 
        modified in the base table (automatic population). Although changes are propagated 
        automatically, these changes might not be reflected immediately in the full-text 
        index. AUTO is the default. 
    
    OFF [ , NO POPULATION] 
        Specifies that SQL Server does not keep a list of changes to the indexed data. When 
        NO POPULATION is not specified, SQL Server populates the index fully after it
        is created.
    
        The NO POPULATION option can be used only when CHANGE_TRACKING is OFF. When 
        NO POPULATION is specified, SQL Server does not populate an index after it is 
        created. The index is only populated after the user executes the 
        ALTER FULLTEXT INDEX command with the START FULL POPULATION or 
        START INCREMENTAL POPULATION clause. 
    

    【讨论】:

    • 谢谢!这听起来和正在发生的事情一模一样。
    • 好吧,也许我说得太早了。索引已经将CHANGE_TRACKING 设置为AUTO。如何检查是否有时间表以及是否已禁用?
    猜你喜欢
    • 1970-01-01
    • 2010-09-12
    • 2016-10-21
    • 2021-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多