Documentation Source Text

Check-in [ec116c4004]
Login

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

Overview
Comment:Add syntax for multi-column matches to fts5.in.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ec116c4004180a810f66dd52a2db49637e32bf5f
User & Date: dan 2015-06-02 19:27:57
Context
2015-06-10
13:01
Add documentation for the columnsize=0 option to fts5.html. check-in: e30da64703 user: dan tags: trunk
2015-06-02
19:27
Add syntax for multi-column matches to fts5.in. check-in: ec116c4004 user: dan tags: trunk
17:24
Clarify the comparison affinity documentation. Change the name of NONE affinity to BLOB. Update the Makefile so that it works with Ubuntu 14.04LTS. check-in: 9ba9e670e1 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/fts5.in.

143
144
145
146
147
148
149
150
151
152
153
154
155


156
157
158
159
160
161
162
...
257
258
259
260
261
262
263


264
265
266
267
268
269
270
271
272



273
274
275
276
277
278
279
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;colname :] &lt;phrase&gt;
&lt;query&gt;     := &#91;colname :] &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;


</codeblock>

<p>
Within an FTS expression a <b>string</b> may be specified in one of two ways:

<ul>
  <li> <p>By enclosing it in double quotes ("). Within a string, any embedded
................................................................................

</codeblock>


<p>
A single phrase or NEAR group may be restricted to matching text within a
specified column of the FTS table by prefixing it with the column name 


followed by a colon character. Column names may be specified using either
of the two forms described for strings above. Unlike strings that are part
of phrases, column names are not passed to the tokenizer module. Column 
names are case-insensitive in the usual way for SQLite column names -
upper/lower case equivalence is understood for ASCII-range characters only.

<codeblock>
  ... MATCH 'colname : NEAR("one two" "three four", 10)'
  ... MATCH '"colname" : 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 to lowest, the operators 
are:








|
|




>
>







 







>
>
|
|
|
|





>
>
>







143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
...
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
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>

<p>
Within an FTS expression a <b>string</b> may be specified in one of two ways:

<ul>
  <li> <p>By enclosing it in double quotes ("). Within a string, any embedded
................................................................................

</codeblock>


<p>
A single phrase or NEAR group may be restricted to matching text within a
specified column of the FTS table by prefixing it with the column name 
followed by a colon character. Or to a set of columns by prefixing it
with a whitespace separated list of column names enclosed in parenthesis
("curly brackets") followed by a colon character. Column names may be specified
using either of the two forms described for strings above. Unlike strings that
are part of phrases, column names are not passed to the tokenizer module.
Column names are case-insensitive in the usual way for SQLite column names -
upper/lower case equivalence is understood for ASCII-range characters only.

<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 to lowest, the operators 
are: