FTS5Pattern
A full text pattern that can query FTS5 virtual tables.
-
The raw pattern string. Guaranteed to be a valid FTS5 pattern.
-
Creates a pattern that matches any token found in the input string; returns nil if no pattern could be built.
FTS5Pattern(matchingAnyTokenIn: "") // nil FTS5Pattern(matchingAnyTokenIn: "foo bar") // foo OR bar
-
Creates a pattern that matches all tokens found in the input string; returns nil if no pattern could be built.
FTS5Pattern(matchingAllTokensIn: "") // nil FTS5Pattern(matchingAllTokensIn: "foo bar") // foo bar
-
Creates a pattern that matches all token prefixes found in the input string; returns nil if no pattern could be built.
FTS3Pattern(matchingAllTokensIn: "") // nil FTS3Pattern(matchingAllTokensIn: "foo bar") // foo* bar*
-
Creates a pattern that matches a contiguous string; returns nil if no pattern could be built.
FTS5Pattern(matchingPhrase: "") // nil FTS5Pattern(matchingPhrase: "foo bar") // "foo bar"
-
Creates a pattern that matches the prefix of an indexed document; returns nil if no pattern could be built.
FTS5Pattern(matchingPrefixPhrase: "") // nil FTS5Pattern(matchingPrefixPhrase: "the word") // ^"the word"
This pattern matches a prefix made of full tokens: “the bat” matches “the bat is happy”, but not “mind the bat”, or “the batcave is dark”.
-
Returns a value that can be stored in the database.
-
Returns an FTS5Pattern initialized from dbValue, if it contains a suitable value.