Imagine I have a Table full of Cars, with Columns Id,Title and Description. These are all in a FullText index.
Now given I have the Id of t开发者_StackOverflowhe Car I want to get a list of all the Keyterms in the Title or Description from the FullText index.
I've got as far as
DECLARE @table_id int = OBJECT_ID(N'Cars');
EXEC sp_fulltext_keymappings @table_id;
which gets me the key (which I'm assuming is the id for the list of keywords given the docid (which I'm assuming is my tables column?)
I just need the list of keyterms. Then ideally the occurrence as well.
Thanks
Someone at work (Thanks Natalia) supplied the magic answer:
select * FROM sys.dm_fts_index_keywords_by_document (DB_ID('CarDatabase'),OBJECT_ID('Cars'))
WHERE Document_id = 2039468
精彩评论