都内で働くSEの技術的なひとりごと / Technical soliloquy of System Engineer working in Tokyo

都内でサラリーマンやってます。SQL Server を中心とした (2023年からは Azure も。) マイクロソフト系(たまに、OSS系などマイクロソフト以外の技術も...)の技術的なことについて書いています。日々の仕事の中で、気になったことを技術要素関係なく気まぐれに選んでいるので記事内容は開発言語、インフラ等ばらばらです。なお、当ブログで発信、発言は私個人のものであり、所属する組織、企業、団体等とは何のかかわりもございません。ブログの内容もきちんと検証して使用してください。英語の勉強のため、英語の

SQL Server 2012 SP2 のトレースフラグ 2453 を試してみたあとで、もう一つの修正に興味が湧いたので、少しだけ読んでみた

 前回、トレースフラグを検証しましたが、SP2 の中でもう一つ興味をそそられるものがありました。ryuchan.hatenablog.com

https://support.microsoft.com/en-us/kb/2958429

Improved full text index diagnostics
In some cases it may be difficult to understand how results of certain full text queries are returned. The full text search subsystem interacts with external word-breakers and stop-lists, and as a result of this interaction the positional information for the keywords in a document may be different from what is observed in the actual text. This is highly relevant when doing 'phrase' or 'NEAR' searches since the delta between the words is used in internal calculations to find matching documents.
In SQL Server 2012 SP2 a new Dynamic Management Function (DMF) was added to provide access to positioning information for keywords indexed in a document. The new DMF is similar to existing DMF sys.dm_fts_index_keywords_by_document, and has the following syntax:
sys. dm_fts_index_keywords_position_by_document
(
DB_ID('database_name'), OBJECT_ID('table_name')
)
Instead of occurrence count, it returns information about each occurrence and its position in the indexed document.
This information can be used to look at the mapping between the text and the internal index which will show the difference in delta, if any, for the search phrase. This can help understanding results from phrase search.

 キーワードの文書内での出現位置が確認できるんですね。これ既に稼働しているシステムに適用した場合、きちんと動作するんだろうか?フルテキストインデックスを再作成しないと動作しないんですかね。(多分、再作成なんだろうなぁ。)あ、SQL Server 2012 SP2 の環境また消しちゃった。ちょっと作るの面倒臭い。なので検証はなしです。時間があったら、覚えてたら、検証してみます。

全文検索SQL Server 本、最近出てないですね。

Pro Full-Text Search in SQL Server 2008

Pro Full-Text Search in SQL Server 2008