Documentation Source Text

Check-in [59ff0eaf28]
Login

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

Overview
Comment:Add "Compiling and Using FTS5" section to fts5.html.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 59ff0eaf288aa3df85f34abe9fd52354218c4b24
User & Date: dan 2015-07-02 20:03:53.102
Context
2015-07-10
17:04
Add an "application porting guide" describing the steps required to port fts3/4 applciations to fts5. Fix some other deficiencies in fts5.html. (check-in: f650ee44b0 user: dan tags: trunk)
2015-07-02
20:03
Add "Compiling and Using FTS5" section to fts5.html. (check-in: 59ff0eaf28 user: dan tags: trunk)
19:01
Update the change log. (check-in: eb5c390d52 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to pages/fts5.in.
180
181
182
183
184
185
186







































187
188
189
190
191
192
193
       on an FTS3/4 table may turn out to be surprisingly slow, as FTS3/4 
       may unpredictably choose to merge together two or more large b-trees
       within it. FTS5 uses incremental merging by default, which limits
       the amount of processing that may take place within any given 
       INSERT, UPDATE or DELETE operation.
</ul>








































<h1 tags="FTS5 query syntax">Full-text Query Syntax</h1>

<p>
The following block contains a summary of the FTS query syntax in BNF form.
A detailed explanation follows.

<codeblock>







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







180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
       on an FTS3/4 table may turn out to be surprisingly slow, as FTS3/4 
       may unpredictably choose to merge together two or more large b-trees
       within it. FTS5 uses incremental merging by default, which limits
       the amount of processing that may take place within any given 
       INSERT, UPDATE or DELETE operation.
</ul>

<h1 tags="FTS5 building">Compiling and Using FTS5</h1>

<p>The FTS5 source code consists of a series of *.c and other files in the
"ext/fts5" directory of the SQLite source tree. A build process reduces this
to just two files - "fts5.c" and "fts5.h" - which are used to build an SQLite
loadable extension or statically linked into an application.

<ol>
  <li> Obtain the latest SQLite code from fossil.
  <li> Create a Makefile as described in [How To Compile SQLite].
  <li> Build the "fts5.c" target. Which also creates fts5.h.
</ol>

<codeblock>
  $ wget -c http://www.sqlite.org/src/tarball/SQLite-trunk.tgz?uuid=trunk -O SQLite-trunk.tgz
  .... output ...
  $ tar -xzf SQLite-trunk.tgz
  $ cd SQLite-trunk
  $ ./configure && make fts5.c
  ... lots of output ...
  $ ls fts5.& 91;ch]
  fts5.c        fts5.h
</codeblock>

<p>
  The code in "fts5.c" may then be compiled into a loadable extension or
  staticly linked into an application as described in 
  [Compiling Loadable Extensions]. There are two entry points defined, both
  of which do the same thing:

<ul>
  <li> sqlite3_fts_init
  <li> sqlite3_fts5_init
</ul>

<p>
  The other file, "fts5.h", is not required to compile the FTS5 extension. 
  It is used by applications that implement [Extending FTS5 | custom FTS5 tokenizers or auxiliary functions].

<h1 tags="FTS5 query syntax">Full-text Query Syntax</h1>

<p>
The following block contains a summary of the FTS query syntax in BNF form.
A detailed explanation follows.

<codeblock>
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
tables].

<codeblock>
  INSERT INTO ft(ft) VALUES('rebuild');
</codeblock>


<h1>Extending FTS5</h1>

<p>FTS5 features APIs allowing it to be extended by:

<ul>
  <li> Adding new auxiliary functions implemented in C, and
  <li> Adding new tokenizers, also implemented in C.
</ul>







|







1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
tables].

<codeblock>
  INSERT INTO ft(ft) VALUES('rebuild');
</codeblock>


<h1 tags="Extending FTS5">Extending FTS5</h1>

<p>FTS5 features APIs allowing it to be extended by:

<ul>
  <li> Adding new auxiliary functions implemented in C, and
  <li> Adding new tokenizers, also implemented in C.
</ul>