Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get word frequencies from SQL Server Full Text Search

Tags:

SQL Server Full-Text Search computes rank based on the frequency of the word in the document and in the set of all documents (TFIDF). Is it possible to access these values directly ?

I would like to find the top-n most frequent words in my table. Is it possible to obtain this list from the full-text search index?

I'm using SQL Server 2005.

like image 608
muriloq Avatar asked Apr 29 '10 17:04

muriloq


People also ask

Does SQL Server support full text search?

Full-Text Search in SQL Server and Azure SQL Database lets users and applications run full-text queries against character-based data in SQL Server tables.

How do I get full-text indexes in SQL Server?

On a table that has a full-text index, you can manually disable or re-enable a table for full-text indexing using SQL Server Management Studio. Expand the server group, expand Databases, and expand the database that contains the table you want to enable for full-text indexing.

How do I verify a full text search in SQL Server?

Look at the list of services on the machine. If full text search is installed you'll see a service named SQL Server FullText Search ([instance]) where [instance] will be the name of the SQL instance that it is associated with.


1 Answers

I don't know of an easy way to do this on SQL Server 2005, but on 2008 there are two Transact-SQL commands do exactly what you need.

  • sys.dm_fts_index_keywords_by_document
    • http://technet.microsoft.com/en-us/library/cc280607.aspx
  • sys.dm_fts_index_keywords
    • http://technet.microsoft.com/en-us/library/cc280900.aspx
like image 100
ccozad Avatar answered Sep 29 '22 05:09

ccozad