Documentation Source Text

Check-in [0742089777]
Login

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

Overview
Comment:Update fts5.in with the UNINDEXED option.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 074208977710cd2cfc8ac83058af0aeede75fc57
User & Date: dan 2015-04-24 20:09:40
Context
2015-04-25
18:17
Add discussion of the AFL fuzzer to the testing document. check-in: 34e2a86993 user: drh tags: trunk
2015-04-24
20:09
Update fts5.in with the UNINDEXED option. check-in: 0742089777 user: dan tags: trunk
2015-04-23
16:50
Start a change log for the 3.8.10 release. check-in: 7013e919d2 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/fts5.in.

318
319
320
321
322
323
324
325
326
327
328
329
330
331
332

333
334
335
336



337
338
339
340
341
342

343
344
345
346
347
348
349
...
352
353
354
355
356
357
358












359
360
361
362
363
364
365
  ... MATCH '(one OR two) three'    <i>-- Syntax error!</i>
  ... MATCH 'func(one two)'         <i>-- Syntax error!</i>
</codeblock>

<h1 tags="FTS5 CREATE TABLE Options">FTS5 Table Creation and Initialization</h1>

<p>Each argument specified as part of a "CREATE VIRTUAL TABLE ... USING fts5 
..." statement is either a column name or a configuration option. A column
name consists of a single FTS5 bareword or a single string literal quoted
in any manner acceptable to SQLite. A configuration option consists of an
FTS5 bareword - the option name - followed by an "=" character, followed by
the option value. The option value is specified using either a single FTS5 
bareword or a string literal, again quoted in any manner acceptable to the
SQLite core. Anything else is a syntax error.


<p>It is an error to attempt to name an fts5 table column "rowid" or "rank",
or to assign the same name to a column as is used by the table itself. This 
is not supported.




<p>It is also an error to add a type, constraint specification or PRIMARY KEY
clause to a column name in an FTS5 CREATE VIRTUAL TABLE statement.

<p> A configuration option consists of an FTS5 bareword - the option name -
followed by an "=" character, followed by a either an FTS5 bareword or a
string literal. For example:


<codeblock>
  CREATE VIRTUAL TABLE mail USING fts5(sender, title, body, tokenize = 'porter ascii');
</codeblock>

<p> There are currently the following configuration options:

................................................................................
  <li> The "prefix" option, used to add [FTS5 prefix indexes | prefix indexes]
       to an FTS5 table.
  <li> The "content" option, used to make the FTS5 table an 
       [FTS5 content option | external content or contentless table].
  <li> The "content_rowid" option, used to set the rowid field of an 
  [FTS5 external content tables | external content table].
</ul>













<h2 tags="FTS5 prefix indexes">Prefix Indexes</h2>

<p> By default, FTS5 maintains a single index recording the location of each
token instance within the document set. This means that querying for complete
tokens is fast, as it requires a single lookup, but querying for a prefix 
token can be slow, as it requires a range scan. For example, to query for







|
|
<
<
<
|
<

>
|
|
|

>
>
>
|
|

|
|
|
>







 







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







318
319
320
321
322
323
324
325
326



327

328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
...
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
  ... MATCH '(one OR two) three'    <i>-- Syntax error!</i>
  ... MATCH 'func(one two)'         <i>-- Syntax error!</i>
</codeblock>

<h1 tags="FTS5 CREATE TABLE Options">FTS5 Table Creation and Initialization</h1>

<p>Each argument specified as part of a "CREATE VIRTUAL TABLE ... USING fts5 
..." statement is either a column declaration or a configuration option. A
<b>column declaration</b> consists of one or more whitespace separated FTS5



barewords or string literals quoted in any manner acceptable to SQLite.


<p>The first string or bareword in a column declaration is the column name. It
is an error to attempt to name an fts5 table column "rowid" or "rank", or to
assign the same name to a column as is used by the table itself. This is not
supported.

<p>Each subsequent string or bareword in a column declaration is a column
option that modifies the behaviour of that column. Column options are
case-independent. Unlike the SQLite core, FTS5 considers unrecognized column
options to be errors. Currently, the only option recognized is 
[unindexed | "UNINDEXED" (see below)].

<p>A <b>configuration option</b> consists of an FTS5 bareword - the option name -
followed by an "=" character, followed by the option value. The option value is
specified using either a single FTS5 bareword or a string literal, again quoted
in any manner acceptable to the SQLite core. For example:

<codeblock>
  CREATE VIRTUAL TABLE mail USING fts5(sender, title, body, tokenize = 'porter ascii');
</codeblock>

<p> There are currently the following configuration options:

................................................................................
  <li> The "prefix" option, used to add [FTS5 prefix indexes | prefix indexes]
       to an FTS5 table.
  <li> The "content" option, used to make the FTS5 table an 
       [FTS5 content option | external content or contentless table].
  <li> The "content_rowid" option, used to set the rowid field of an 
  [FTS5 external content tables | external content table].
</ul>

<h2 tags="unindexed">The UNINDEXED column option</h2>

<p>The contents of columns qualified with the UNINDEXED column option are not
added to the FTS index. This means that for the purposes of MATCH queries and
[FTS5 auxiliary functions], the column contains no matchable tokens. 

<p>For example, to avoid adding the contents of the "uuid" field to the FTS
index:
<codeblock>
  CREATE VIRTUAL TABLE customers USING fts5(name, addr, uuid UNINDEXED);
</codeblock>

<h2 tags="FTS5 prefix indexes">Prefix Indexes</h2>

<p> By default, FTS5 maintains a single index recording the location of each
token instance within the document set. This means that querying for complete
tokens is fast, as it requires a single lookup, but querying for a prefix 
token can be slow, as it requires a range scan. For example, to query for