Inherits from NSManagedObject
Declared in RKSearchableManagedObject.h
RKSearchableManagedObject.m

Overview

RKSearchableManagedObject provides an abstract base class for Core Data entities that are searchable using the RKManagedObjectSearchEngine interface. The collection of search words is maintained by the RKSearchWordObserver singleton at managed object context save time.

Tasks

Configuring Searchable Attributes

  • + searchableAttributes

    Returns an array of attributes which should be processed by the search word observer to build the set of search words for entities with the type of the receiver. Subclasses must provide an implementation for indexing to occur as the base implementation returns an empty array.

Obtaining a Search Predicate

Managing the Search Words

  •   searchWords

    The set of tokenized search words contained in the receiver.

    property
  • – refreshSearchWords

    Rebuilds the set of tokenized search words associated with the receiver by processing the searchable attributes and tokenizing the contents into RKSearchWord instances.

SearchWordsAccessors Methods

Properties

searchWords

The set of tokenized search words contained in the receiver.

@property (nonatomic, retain) NSSet *searchWords

Declared In

RKSearchableManagedObject.h

Class Methods

predicateForSearchWithText:searchMode:

A predicate that will search for the specified text with the specified mode. Mode can be configured to be RKSearchModeAnd or RKSearchModeOr.

+ (NSPredicate *)predicateForSearchWithText:(NSString *)searchText searchMode:(RKSearchMode)mode

Return Value

A predicate that will search for the specified text with the specified mode.

Declared In

RKSearchableManagedObject.h

searchableAttributes

Returns an array of attributes which should be processed by the search word observer to build the set of search words for entities with the type of the receiver. Subclasses must provide an implementation for indexing to occur as the base implementation returns an empty array.

+ (NSArray *)searchableAttributes

Return Value

An array of attribute names containing searchable textual content for entities with the type of the receiver.

Discussion

Warning: NOTE: May only include attributes property names, not key paths.

Declared In

RKSearchableManagedObject.h

Instance Methods

addSearchWords:

Adds a set of search word objects to the receiver’s set of search words.

- (void)addSearchWords:(NSSet *)searchWords

Parameters

searchWords

The set of search words to be added to receiver’s the set of search words.

Declared In

RKSearchableManagedObject.h

addSearchWordsObject:

Adds a search word object to the receiver’s set of search words.

- (void)addSearchWordsObject:(RKSearchWord *)searchWord

Parameters

searchWord

The search word to be added to the set of search words.

Declared In

RKSearchableManagedObject.h

refreshSearchWords

Rebuilds the set of tokenized search words associated with the receiver by processing the searchable attributes and tokenizing the contents into RKSearchWord instances.

- (void)refreshSearchWords

Declared In

RKSearchableManagedObject.h

removeSearchWords:

Removes a set of search word objects from the receiver’s set of search words.

- (void)removeSearchWords:(NSSet *)searchWords

Parameters

searchWords

The set of search words to be removed from receiver’s the set of search words.

Declared In

RKSearchableManagedObject.h

removeSearchWordsObject:

Removes a search word object from the receiver’s set of search words.

- (void)removeSearchWordsObject:(RKSearchWord *)searchWord

Parameters

searchWord

The search word to be removed from the receiver’s set of search words.

Declared In

RKSearchableManagedObject.h