AVSearchQuery Class Reference

Inherits from NSObject
Declared in AVSearchQuery.h

+ searchWithQueryString:

使用 queryString 构造一个 AVSearchQuery 对象

+ (instancetype)searchWithQueryString:(NSString *)queryString

Return Value

AVSearchQuery 实例

Discussion

使用 queryString 构造一个 AVSearchQuery 对象

Declared In

AVSearchQuery.h

  className

查询的 className,默认为 nil,即包括所有启用了应用内搜索的 Class

@property (nonatomic, copy, nullable) NSString *className

Discussion

查询的 className,默认为 nil,即包括所有启用了应用内搜索的 Class

Declared In

AVSearchQuery.h

  skip

The number of objects to skip before returning any.

@property (nonatomic, assign) NSInteger skip

Discussion

The number of objects to skip before returning any.

Declared In

AVSearchQuery.h

  limit

返回集合大小上限,默认值为100,最大为1000

@property (nonatomic, assign) NSInteger limit

Discussion

返回集合大小上限,默认值为100,最大为1000

Declared In

AVSearchQuery.h

  queryString

@property (nonatomic, copy, nullable) NSString *queryString

Discussion

查询字符串,具体语法参考 http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax

Declared In

AVSearchQuery.h

  sortBuilder

查询的AVSearchSortBuilder,使用更丰富的排序选项

@property (nonatomic, strong, nullable) AVSearchSortBuilder *sortBuilder

Discussion

查询的AVSearchSortBuilder,使用更丰富的排序选项

Declared In

AVSearchQuery.h

  hits

符合查询条件的记录条数

@property (nonatomic, assign, readonly) NSInteger hits

Discussion

符合查询条件的记录条数

Declared In

AVSearchQuery.h

  sid

@property (nonatomic, copy, nullable) NSString *sid

Discussion

Declared In

AVSearchQuery.h

  fields

查询的字段列表,可选。

@property (nonatomic, strong, nullable) NSArray *fields

Discussion

查询的字段列表,可选。

Declared In

AVSearchQuery.h

  highlights

返回结果的高亮语法,默认为 “*” 语法规则可以参考 http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html#highlighting-settings

@property (nonatomic, copy, nullable) NSString *highlights

Discussion

返回结果的高亮语法,默认为 “*” 语法规则可以参考 http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html#highlighting-settings

Declared In

AVSearchQuery.h

  cachePolicy

缓存策略

@property (readwrite, assign) AVCachePolicy cachePolicy

Discussion

缓存策略

Declared In

AVSearchQuery.h

  maxCacheAge

@property (readwrite, assign) NSTimeInterval maxCacheAge

– includeKey:

Make the query include AVObjects that have a reference stored at the provided key. This has an effect similar to a join. You can use dot notation to specify which fields in the included object are also fetch.

- (void)includeKey:(NSString *)key

Parameters

key

The key to load child AVObjects for.

Discussion

Make the query include AVObjects that have a reference stored at the provided key. This has an effect similar to a join. You can use dot notation to specify which fields in the included object are also fetch.

Declared In

AVSearchQuery.h

– findObjects

根据查询条件获取结果对象

- (nullable NSArray *)findObjects

Return Value

AVObjects 数组

Discussion

根据查询条件获取结果对象

Declared In

AVSearchQuery.h

– findObjects:

根据查询条件获取结果对象,如果有 error,则设置一个 error

- (nullable NSArray *)findObjects:(NSError **)error

Parameters

error

指针

Return Value

AVObjects 数组

Discussion

根据查询条件获取结果对象,如果有 error,则设置一个 error

Declared In

AVSearchQuery.h

– findObjectsAndThrowsWithError:

An alias of [AVSearchQuery findObjects:] methods that supports Swift exception. @seealso [AVSearchQuery findObjects:]

- (nullable NSArray *)findObjectsAndThrowsWithError:(NSError **)error

Discussion

An alias of [AVSearchQuery findObjects:] methods that supports Swift exception. @seealso [AVSearchQuery findObjects:]

Declared In

AVSearchQuery.h

– findInBackground:

异步获取搜索结果,并回调block

- (void)findInBackground:(AVArrayResultBlock)block

Parameters

block

需要有这样的方法签名 (NSArray objects, NSError error)

Discussion

异步获取搜索结果,并回调block

Declared In

AVSearchQuery.h

– orderByAscending:

搜索结果会根据关键字,按升序排序

- (void)orderByAscending:(NSString *)key

Parameters

key

排序关键字

Discussion

搜索结果会根据关键字,按升序排序

Declared In

AVSearchQuery.h

– addAscendingOrder:

添加一个升序排序关键字。排序优先级由添加关键字的前后顺序决定。

- (void)addAscendingOrder:(NSString *)key

Parameters

key

排序关键字

Discussion

添加一个升序排序关键字。排序优先级由添加关键字的前后顺序决定。

Declared In

AVSearchQuery.h

– orderByDescending:

搜索结果会根据关键字,按降序排序

- (void)orderByDescending:(NSString *)key

Parameters

key

排序关键字

Discussion

搜索结果会根据关键字,按降序排序

Declared In

AVSearchQuery.h

– addDescendingOrder:

添加一个降序排序关键字。关键字的排序优先级由添加关键字的前后顺序决定。

- (void)addDescendingOrder:(NSString *)key

Parameters

key

排序关键字

Discussion

添加一个降序排序关键字。关键字的排序优先级由添加关键字的前后顺序决定。

Declared In

AVSearchQuery.h

– orderBySortDescriptor:

根据 NSSortDescriptor 排序搜索结果

- (void)orderBySortDescriptor:(NSSortDescriptor *)sortDescriptor

Parameters

sortDescriptor

排序描述符

Discussion

根据 NSSortDescriptor 排序搜索结果

Declared In

AVSearchQuery.h

– orderBySortDescriptors:

根据 NSSortDescriptor 数组排序搜索结果

- (void)orderBySortDescriptors:(NSArray *)sortDescriptors

Parameters

sortDescriptors

NSSortDescriptor 数组

Discussion

根据 NSSortDescriptor 数组排序搜索结果

Declared In

AVSearchQuery.h