Couchbase Lite
Objective-C API for iOS and Mac OS
Instance Methods | Properties | List of all members
CBLFullTextQueryRow Class Reference

A result row from a full-text query. More...

#import <CBLQuery+FullTextSearch.h>

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 search term matched by a particular match. More...
 
- Instance Methods inherited from CBLQueryRow
(id) - keyAtIndex:
 If this row's key is an array, returns the item at that index in the array. More...
 

Properties

NSString * fullText
 The text emitted when the view was indexed, which contains the match. More...
 
NSUInteger matchCount
 The number of matches 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...
 
NSDictionary * 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...
 
NSArray * conflictingRevisions
 Returns all conflicting revisions of the document, as an array of CBLRevision, or nil if the document is not in conflict. More...
 

Detailed Description

A result row from a full-text query.

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

Method Documentation

- (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.
- (NSRange) textRangeOfMatch: (NSUInteger)  matchNumber

The character range in the fullText of a particular match.

- (NSUInteger) termIndexOfMatch: (NSUInteger)  matchNumber

The search term matched by a particular match.

Search terms are the individual words (or quoted phrases) in the full-text search expression. They're numbered starting from 0, except terms prefixed with "NOT" are skipped. (Details at http://sqlite.org/fts3.html#matchable )

Property Documentation

- (NSString*) fullText
readatomicassign

The text emitted when the view was indexed, which contains the match.

- (NSUInteger) matchCount
readatomicassign

The number of matches found in the fullText.


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