RelationTextIndex
public class RelationTextIndex
An index for fast full-text searches of large quantities of text. Manages two Relations which provide the text and related info, and provides Relations which provide search results.
-
Undocumented
See moreDeclaration
Swift
public enum Error : RelationError -
Initialize a new index object.
Throws
SQLiteDatabase.Error if something went wrong with SQLite setup.Declaration
Swift
public init(ids: (Relation, Attribute), content: (Relation, Attribute), columnConfigs: [ColumnConfig]) throwsParameters
idsA Relation which provides page IDs, and the attribute for the IDs. This is used to get the initial list of pages.
contentA Relation which provides page content and IDs, plus the attribute for the IDs.
contentTextExtractorA function which, given a Row from the content Relation, returns the text that row contains.
-
Return a Relation which contains matches for the given query.
Declaration
Swift
public func search(_ query: String) -> SearchRelationParameters
queryThe query, using SQLite FTS4 syntax.
Return Value
A Relation containing the IDs of matching entries. It contains only IDs, under the ID attribute provided for the content relation passed into
init. It can be renamed/joined with other tables if more information is desired.
-
A Relation which holds search results from an index. The scheme is a single attribute: the contentIDAttribute which was passed in to the index. The Relation’s contents update asynchronously when the search query is changed.
See moreDeclaration
Swift
public class SearchRelation : MemoryTableRelation
-
Undocumented
Declaration
Swift
public static let matchStartCharacter: UnicodeScalar -
Undocumented
Declaration
Swift
public static let matchEndCharacter: UnicodeScalar -
Undocumented
Declaration
Swift
public static let ellipsesCharacter: UnicodeScalar -
A structured representation of a snippet. Initialize it with the raw string from a snippet column of a
See moreSearchRelation, and it will read the special characters embedded in the snippet string and transform them into this structured representation.Declaration
Swift
public struct StructuredSnippet : Hashable
-
Configuration for a column of searchable text.
See moreDeclaration
Swift
public struct ColumnConfig
RelationTextIndex Class Reference