Couchbase Lite
Objective-C API for iOS and Mac OS
CBLFullTextQueryRow Class Reference

Detailed Description

A result row from a full-text query.

A CBLQuery with its .fullTextQuery property set will produce CBLFullTextQueryRows.

Inheritance diagram for CBLFullTextQueryRow:
CBLQueryRow

Instance Methods

(NSString *) - snippetWithWordStart:wordEnd:
 Returns a short substring of the full text containing at least some of the matched words. More...
 
(NSRange) - textRangeOfMatch:
 The character range in the fullText of a particular match. More...
 
(NSUInteger) - termIndexOfMatch:
 The index of the search term matched by a particular match. More...
 
- Instance Methods inherited from CBLQueryRow
(nullable id) - keyAtIndex:
 If this row's key is an array, returns the item at that index in the array. More...
 
() - CBLArrayOf
 Returns all conflicting revisions of the document, as an array of CBLSavedRevision, or nil if the document is not in conflict. More...
 
(instancetype) - NS_UNAVAILABLE
 

Properties

NSString * fullText
 The text emitted when the view was indexed (the argument to CBLTextKey()) which contains the match(es). More...
 
NSUInteger matchCount
 The number of query words that were found in the fullText. More...
 
- Properties inherited from CBLQueryRow
id key
 The row's key: this is the first parameter passed to the emit() call that generated the row. More...
 
id value
 The row's value: this is the second parameter passed to the emit() call that generated the row. More...
 
NSString * documentID
 The ID of the document described by this view row. More...
 
NSString * sourceDocumentID
 The ID of the document that caused this view row to be emitted. More...
 
NSString * documentRevisionID
 The revision ID of the document this row was mapped from. More...
 
CBLDatabasedatabase
 
CBLDocumentdocument
 The document this row was mapped from. More...
 
CBLJSONDict * documentProperties
 The properties of the document this row was mapped from. More...
 
id key0
 Convenience for use in keypaths. More...
 
id key1
 
id key2
 
id key3
 
UInt64 sequenceNumber
 The database sequence number of the associated doc/revision. More...
 

Method Documentation

◆ snippetWithWordStart:wordEnd:()

- (NSString*) snippetWithWordStart: (NSString *)  wordStart
wordEnd: (NSString *)  wordEnd 

Returns a short substring of the full text containing at least some of the matched words.

This is useful to display in search results, and is faster than fetching the .fullText. NOTE: The "fullTextSnippets" property of the CBLQuery must be set to YES to enable this; otherwise the result will be nil.

Parameters
wordStartA delimiter that will be inserted before every instance of a match.
wordEndA delimiter that will be inserted after every instance of a match.

◆ textRangeOfMatch:()

- (NSRange) textRangeOfMatch: (NSUInteger)  matchNumber

The character range in the fullText of a particular match.

◆ termIndexOfMatch:()

- (NSUInteger) termIndexOfMatch: (NSUInteger)  matchNumber

The index of the search term matched by a particular match.

Search terms are the individual words in the full-text search expression, skipping duplicates and noise/stop-words. They're numbered from zero.

Property Documentation

◆ fullText

- (NSString*) fullText
readatomicassign

The text emitted when the view was indexed (the argument to CBLTextKey()) which contains the match(es).

◆ matchCount

- (NSUInteger) matchCount
readatomicassign

The number of query words that were found in the fullText.

(If a query word appears more than once, only the first instance is counted.)


The documentation for this class was generated from the following file: