Documentation Source Text

Check-in [e79e555f14]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update fts5.html to document negative column filters.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e79e555f146d5bf18644ed10f3dd6969aec88ea0
User & Date: dan 2016-08-09 19:48:07
Context
2016-08-10
12:01
Fix typo in FTS3 docs. check-in: 58a14bf9e1 user: drh tags: trunk
2016-08-09
19:48
Update fts5.html to document negative column filters. check-in: e79e555f14 user: dan tags: trunk
17:38
Improvements to the PRAGMA secure_delete documentation. check-in: ec87587f77 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/fts5.in.

169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
...
308
309
310
311
312
313
314












315
316
317
318
319
320
321
The following block contains a summary of the FTS query syntax in BNF form.
A detailed explanation follows.

<codeblock>
&lt;phrase&gt;    := string &#91;*]
&lt;phrase&gt;    := &lt;phrase&gt; + &lt;phrase&gt;
&lt;neargroup&gt; := NEAR ( &lt;phrase&gt; &lt;phrase&gt; ... &#91;, N] )
&lt;query&gt;     := &#91;&lt;colspec&gt; :] &lt;phrase&gt;
&lt;query&gt;     := &#91;&lt;colspec&gt; :] &lt;neargroup&gt;
&lt;query&gt;     := ( &lt;query&gt; )
&lt;query&gt;     := &lt;query&gt; AND &lt;query&gt;
&lt;query&gt;     := &lt;query&gt; OR &lt;query&gt;
&lt;query&gt;     := &lt;query&gt; NOT &lt;query&gt;
&lt;colspec&gt;   := colname
&lt;colspec&gt;   := { colname1 colname2 ... }
</codeblock>
................................................................................
  ... MATCH 'colname : NEAR("one two" "three four", 10)'
  ... MATCH '"colname" : one + two + three'

  ... MATCH '{col1 col2} : NEAR("one two" "three four", 10)'
  ... MATCH '{col2 col1 col3} : one + two + three'
</codeblock>













<p>
Phrases and NEAR groups may be arranged into expressions using <b>boolean
operators</b>. In order of precedence, from highest (tightest grouping) to
lowest (loosest grouping), the operators are:

<table striped=1>
  <tr><th>Operator <th>Function







|
|







 







>
>
>
>
>
>
>
>
>
>
>
>







169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
...
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
The following block contains a summary of the FTS query syntax in BNF form.
A detailed explanation follows.

<codeblock>
&lt;phrase&gt;    := string &#91;*]
&lt;phrase&gt;    := &lt;phrase&gt; + &lt;phrase&gt;
&lt;neargroup&gt; := NEAR ( &lt;phrase&gt; &lt;phrase&gt; ... &#91;, N] )
&lt;query&gt;     := &#91; &#91;-] &lt;colspec&gt; :] &lt;phrase&gt;
&lt;query&gt;     := &#91; &#91;-] &lt;colspec&gt; :] &lt;neargroup&gt;
&lt;query&gt;     := ( &lt;query&gt; )
&lt;query&gt;     := &lt;query&gt; AND &lt;query&gt;
&lt;query&gt;     := &lt;query&gt; OR &lt;query&gt;
&lt;query&gt;     := &lt;query&gt; NOT &lt;query&gt;
&lt;colspec&gt;   := colname
&lt;colspec&gt;   := { colname1 colname2 ... }
</codeblock>
................................................................................
  ... MATCH 'colname : NEAR("one two" "three four", 10)'
  ... MATCH '"colname" : one + two + three'

  ... MATCH '{col1 col2} : NEAR("one two" "three four", 10)'
  ... MATCH '{col2 col1 col3} : one + two + three'
</codeblock>

<p>
If a column filter specification is preceded by a "-" character, then
it is interpreted as a list of column not to match against. For example:

<codeblock>
  <i>-- Search for matches in all columns except "colname"</i>
  ... MATCH '- colname : NEAR("one two" "three four", 10)'

  <i>-- Search for matches in all columns except "col1", "col2" and "col3"</i>
  ... MATCH '- {col2 col1 col3} : one + two + three'
</codeblock>

<p>
Phrases and NEAR groups may be arranged into expressions using <b>boolean
operators</b>. In order of precedence, from highest (tightest grouping) to
lowest (loosest grouping), the operators are:

<table striped=1>
  <tr><th>Operator <th>Function