YapDatabaseFullTextSearchSnippetOptions

@interface YapDatabaseFullTextSearchSnippetOptions : NSObject <NSCopying>

This class represents options that may be passed to the FTS snippet function.

It correlates with the snippet funtion arguments as defined in sqlite’s FTS module: http://www.sqlite.org/fts3.html#section_4_2

For example, if you were searching for the word favorite, then a returned snippet may look something like this:

one of my favorite cheese pairings is

  • Undocumented

    Declaration

    Objective-C

    + (NSString *)defaultStartMatchText;

    Swift

    class func defaultStartMatchText() -> String
  • Undocumented

    Declaration

    Objective-C

    + (NSString *)defaultEndMatchText;

    Swift

    class func defaultEndMatchText() -> String
  • Undocumented

    Declaration

    Objective-C

    + (NSString *)defaultEllipsesText;

    Swift

    class func defaultEllipsesText() -> String
  • Undocumented

    Declaration

    Objective-C

    + (int)defaultNumberOfTokens;

    Swift

    class func defaultNumberOfTokens() -> Int32
  • Undocumented

    Declaration

    Objective-C

    - (id)init;

    Swift

    init()
  • The startMatchText is inserted before matched terms/phrases, and also before injected ellipses text. It is used to mark the beginning of special text within the snippet.

    If not set, it will be the defaultStartMatchText

    See

    defaultStartMatchText

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull startMatchText;

    Swift

    var startMatchText: String { get set }
  • The endMatchText is inserted after matched terms/phrases, and also after injected ellipses text. It is used to mark the end of special text within the snippet.

    If not set, it will be the defaultEndMatchText

    See

    defaultEndMatchText

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull endMatchText;

    Swift

    var endMatchText: String { get set }
  • If the full text from the column is too big, the snippets will be a small subsection of the snippet, centered on matching terms/phrases. When this occurs, and the snippet is truncated on the left and/or right, then the ellipsesText will be inserted on the left and/or right.

    If not set, it will be the defaultEllipsesText: @

    See

    defaultEllipsesText

    See

    numberOfTokens

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull ellipsesText;

    Swift

    var ellipsesText: String { get set }
  • The column name from which to extract the returned fragments of text from. If nil, then the text may be extracted from any column.

    If not set, the default value is nil.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *columnName;

    Swift

    var columnName: String? { get set }
  • The numberOfTokens is used as the (approximate) number of tokens to include in the returned snippet text value.

    If not set, it will be defaultNumberOfTokens: 15

    Setting this to a value of zero resets the value to the default. Negative values are allowed, as the snippet function automatically uses the absolute value.

    The maximum allowable absolute value is 64.

    See

    defaultNumberOfTokens

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) int numberOfTokens;

    Swift

    var numberOfTokens: Int32 { get set }