doc
 All Classes Functions Variables Properties
Public Member Functions | Protected Attributes | Properties
EMSearchQueryDataSource Class Reference

Inherits NSObject, and <EMSearchQueryDataSource>.

Inherited by EMEndecaSearchQueryDataSource.

List of all members.

Public Member Functions

(id) - initWithQuery:
(id) - initWithQuery:endpoint:
(NSArray *) - facetResults
(void) - submitSearchQuery
(void) - submitFacetQuery
(void) - submitSortQuery
(void) - releaseResult
(void) - loadAllFacetValuesForFacet:facetId:
(BOOL) - isLoadingFacet
(EMURLSearchRequest *) - requestWithQuery:delegate:

Protected Attributes

NSString * _endpoint
NSMutableArray * _delegates
BOOL loaded
BOOL loading
BOOL loadingMore
BOOL loadingFacet
EMSearchQuery_query
EMSearchResult_result
NSMutableArray * _results
EMURLSearchRequest_request
NSInteger _firstPageSize

Properties

NSString * endpoint
NSInteger firstPageSize
BOOL categoryResult
NSString * didYouMean
NSString * autocorrect
EMContentItemcontentItem

Member Function Documentation

- (NSArray *) facetResults

returns an array of EMFacetResult objects

- (id) initWithQuery: (EMSearchQuery *)  query
endpoint: (NSString *)  endpoint 

convenience constructor for initializing the data source with the query and the endpoint

- (BOOL) isLoadingFacet

If loadAllFacetValues:(NSString *)facetName has been called, a query will be submitted to load all facet values for the given facet. Currently only one call can be made at a time, for simplicity.

- (void) loadAllFacetValuesForFacet: (NSString *)  facetName
facetId: (NSString *)  facetId 

Currently only one call can be made at a time, for simplicity.

- (void) releaseResult

Used to free up memory. Releases the result, but not the query

- (EMURLSearchRequest *) requestWithQuery: (EMSearchQuery *)  query
delegate: (id<TTURLRequestDelegate>)  delegate 

Concrete subclasses must override this method to return a EMURLSearchRequest object for the given EMSearchQuery

- (void) submitFacetQuery

Submits the data source's query, releasing the old result altogether.

This should be the same as submitSearchQuery except that it disables did you mean.

  • Resetting the query's offset to 0
  • Setting the query's didYouMeanEnabled to NO
  • Setting the query's recordsPerPage to self.firstPageSize
  • Setting the query's returnFacets to YES

Submits the data source's query, releasing the old result altogether.

In addition this method prepares the query for a new search by:

  • Resetting the query's offset to 0
  • Setting the query's didYouMeanEnabled to YES
  • Setting the query's recordsPerPage to self.firstPageSize
  • Setting the query's returnFacets to YES
- (void) submitSortQuery

Submits the data source's query, clearing the records from the result, but not the facets.

In addition this method prepares the query for a new sort query by:

  • Resetting the offset to 0
  • Setting the query's didYouMeanEnabled to NO
  • Setting the query's recordsPerPage to self.firstPageSize
  • Setting the query's returnFacets to NO

Property Documentation

- (NSString *) autocorrect [read, assign]

The autocorrect returned by the search results. Returns nil if there is no autocorrect.

- (BOOL) categoryResult [read, assign]

A category query is similar to a records query. Both specify a a navigation state, but in one, records (products) are returned, in the other, categories are returned.

- (EMContentItem *) contentItem [read, assign]

The EMContentItem returned by the search results.

- (NSString *) didYouMean [read, assign]

The didYouMean returned by the search results. Returns nil if there is no did you mean.

- (NSString *) endpoint [read, write, retain]

Stores the base url for the search query. If this property is never set, this will return the value at [[EMConfiguration globalConfig] searchEndpoint]

- (NSInteger) firstPageSize [read, write, assign]

The number of records that will be requested when calling submitSearchQuery or submitSortQuery.

Default = 10.


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