Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Add a description of the "^" syntax to fts5.in. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
58bbcf8b2f2ea339eca791a46ecc24ce |
User & Date: | dan 2017-11-25 14:02:15.511 |
Context
2017-11-25
| ||
15:22 | Update the fts5 documentation to make it clear that the xDestroy function is not invoked if either xCreateFunction or xCreateTokenizer fails. (check-in: 820de7c995 user: dan tags: trunk) | |
14:02 | Add a description of the "^" syntax to fts5.in. (check-in: 58bbcf8b2f user: dan tags: trunk) | |
2017-11-13
| ||
23:06 | Continuing work on the walformat.html document. (check-in: 74c71c744b user: drh tags: trunk) | |
Changes
Changes to pages/fts5.in.
︙ | ︙ | |||
169 170 171 172 173 174 175 | The following block contains a summary of the FTS query syntax in BNF form. A detailed explanation follows. <codeblock> <phrase> := string [*] <phrase> := <phrase> + <phrase> <neargroup> := NEAR ( <phrase> <phrase> ... [, N] ) | | | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | The following block contains a summary of the FTS query syntax in BNF form. A detailed explanation follows. <codeblock> <phrase> := string [*] <phrase> := <phrase> + <phrase> <neargroup> := NEAR ( <phrase> <phrase> ... [, N] ) <query> := [ [-] <colspec> :] [^] <phrase> <query> := [ [-] <colspec> :] <neargroup> <query> := [ [-] <colspec> :] ( <query> ) <query> := <query> AND <query> <query> := <query> OR <query> <query> := <query> NOT <query> <colspec> := colname <colspec> := { colname1 colname2 ... } |
︙ | ︙ | |||
250 251 252 253 254 255 256 257 258 259 260 261 262 263 | </codeblock> <p>The final query in the block above may not work as expected. Because the "*" character is inside the double-quotes, it will be passed to the tokenizer, which will likely discard it (or perhaps, depending on the specific tokenizer in use, include it as part of the final token) instead of recognizing it as a special FTS character. <h2 tags="FTS5 NEAR queries">FTS5 NEAR Queries</h2> <p>Two or more phrases may be grouped into a <b>NEAR group</b>. A NEAR group is specified by the token "NEAR" (case sensitive) followed by an open parenthesis character, followed by two or more whitespace separated phrases, optionally followed by a comma and the numeric parameter <i>N</i>, followed by a close parenthesis. For example: | > > > > > > > > > > > > > > > > > > | 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | </codeblock> <p>The final query in the block above may not work as expected. Because the "*" character is inside the double-quotes, it will be passed to the tokenizer, which will likely discard it (or perhaps, depending on the specific tokenizer in use, include it as part of the final token) instead of recognizing it as a special FTS character. <h2 tags="FTS5 initial token queries">FTS5 Initial Token Queries</h2> <p> If a "^" character appears immediately before a phrase that is not part of a NEAR query, then that phrase only matches a document only if it starts at the first token in a column. The "^" syntax may be combined with a [FTS5 column filters|column filter], but may not be inserted into the middle of a phrase. <codeblock> ... MATCH '^one' <i>-- first token in any column must be "one"</i> ... MATCH '^ one + two' <i>-- phrase "one two" must appear at start of a column</i> ... MATCH '^ "one two"' <i>-- same as previous </i> ... MATCH 'a : ^two' <i>-- first token of column "a" must be "two"</i> ... MATCH 'NEAR(^one, two)' <b>-- syntax error! </b> ... MATCH 'one + ^two' <b>-- syntax error! </b> ... MATCH '"^one two"' <b>-- May not work as expected!</b> </codeblock> <h2 tags="FTS5 NEAR queries">FTS5 NEAR Queries</h2> <p>Two or more phrases may be grouped into a <b>NEAR group</b>. A NEAR group is specified by the token "NEAR" (case sensitive) followed by an open parenthesis character, followed by two or more whitespace separated phrases, optionally followed by a comma and the numeric parameter <i>N</i>, followed by a close parenthesis. For example: |
︙ | ︙ |