title: Full Text Near with Max Distance Syntax in SQL Server 2008
body: <p>I'm trying to write a full text search using a near proximity term with a max distance.  </p>
  
  <p>From what I can tell of the grammer...</p>
  
  <pre><code>    &lt;custom_proximity_term&gt; ::= 
    NEAR ( 
       {
          { &lt;simple_term&gt; | &lt;prefix_term&gt; } [ ,…n ]
       |
          ( { &lt;simple_term&gt; | &lt;prefix_term&gt; } [ ,…n ] ) 
        [, &lt;maximum_distance&gt; [, &lt;match_order&gt; ] ]
       }
         ) 
  
        &lt;maximum_distance&gt; ::= { integer | MAX }
        &lt;match_order&gt; ::= { TRUE | FALSE } 
  </code></pre>
  
  <p>...I should be able to use <code>NEAR</code> like such:</p>
  
  <pre><code>'NEAR(term1,term2,5)'
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>'NEAR((term1,term2),5)'
  </code></pre>
  
  <p>However always throws a syntax error.</p>
  
  <pre><code>Syntax error near '(' in the full-text search condition 'NEAR((term1, term2), 4, TRUE)'.
  </code></pre>
  
  <p>Even when i try to copy the exact search from a microsoft Example it throws an error:</p>
  
  <pre><code>USE AdventureWorks2012
  GO
  
  SELECT DocumentNode, Title, DocumentSummary
  FROM Production.Document AS DocTable 
  INNER JOIN CONTAINSTABLE(Production.Document, Document,
    'NEAR(bracket, reflector)' ) /* doesn't like this */ AS KEY_TBL
    ON DocTable.DocumentNode = KEY_TBL.[KEY]
  WHERE KEY_TBL.RANK &gt; 50
  ORDER BY KEY_TBL.RANK DESC
  GO
  
  Syntax error near '(' in the full-text search condition 'NEAR(bracket, reflector)'.
  </code></pre>