Full-Text Query Process

  1. A query that uses one of the full-text constructs (that is CONTAINS, FREETEXT, CONTAINSTABLE(), or FREETEXTTABLE) is submitted to the SQL Relational Engine.
  2. Queries containing either the CONTAINS or FREETEXT predicate are rewritten so that the rowset returned from the Full-Text Provider later will be automatically joined to the table that the predicate is acting upon. This rewrite is the mechanism used to ensure that these predicates are a seamless extension to SQL Server. By specifying CONTAINS and FREETEXT, you do not have to concern yourself with or even know about the details of the underlying invocation of the Microsoft Search Service.
  3. The Full-Text Provider is invoked, passing the following information:
    • The ft_search_condition
    • The friendly name of the full-text catalog where the full-text index of a table resides
    • The locale ID to be used for language (for example, word breaking)
    • The identities of the database, table, and column

    If the query is comprised of more than one full-text construct, the full-text provider is invoked separately for each construct.

    The SQL Server Relational Engine does not look into the contents of the ft_search_condition. Instead, this is passed along to the full-text provider, which checks it for validity and then creates the appropriate internal representation of the full-text search condition.

  4. The command is passed to Querying Support.
  5. Querying Support returns a rowset that contains the unique key column values for the rows that match the full-text search criteria. A rank value also is returned for each row.
  6. The rowset is passed to the SQL Server Relational Engine. If processing either a CONTAINSTABLE() or FREETEXTTABLE() function, RANK values are returned; otherwise, the rank value is filtered out.
  7. The rowset values are plugged into the query with values obtained from the relational database, and the result set is returned to the user.