Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is the setup script (thanks to Itzik Ben-Gan (author Querying SQL Server)) which will allow you to use example query at bottom of thesaurus:</p> <pre><code>IF OBJECT_ID('dbo.Documents', 'table') IS NOT NULL DROP TABLE dbo.Documents; CREATE TABLE dbo.Documents ( id INT NOT NULL IDENTITY, title NVARCHAR(100) NOT NULL, doctype NCHAR(4) NOT NULL, docexcerpt NVARCHAR(1000) NOT NULL, doccontent VARBINARY(MAX) NOT NULL, CONSTRAINT PK_Documents PRIMARY KEY CLUSTERED(id) ); GO INSERT INTO dbo.Documents (title, doctype, docexcerpt, doccontent) SELECT N'Introduction to Data Mining', N'docx', N'Using Data Mining is becoming more a necessity for every company and not an advantage of some rare companies anymore. ', bulkcolumn; GO </code></pre> <p>--Edit the thesaurus file by adding </p> <pre><code>&lt;expansion&gt; &lt;sub&gt;need&lt;/sub&gt; &lt;sub&gt;necessity&lt;/sub&gt; &lt;/expansion&gt; </code></pre> <p>--Run the following to reload your edited thesaurus</p> <pre><code>EXEC sys.sp_fulltext_load_thesaurus_file 1033; GO </code></pre> <p>And in a separate batch, execute the following command:</p> <pre><code>SELECT * FROM dbo.Documents WHERE FREETEXT(doccontent, N'FORMSOF(THESAURUS, need)'); GO </code></pre> <p>The word "need" is not in the docexcerpt, however as the synonym is loaded in the thesaurus, the row will return if the thesaurus is loaded properly. If you have issues with that, there are many StackOverflow articles and BOL entries on how to load/configure it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload