CotC C# SDK for Unity  v1.4.0.1
Making social games is easy !
Public Member Functions | List of all members
CotcSdk.CloudIndexing Class Reference

Description

Provides an API allowing to manipulate an index.

Public Member Functions

Promise< DoneDeleteObject (string objectId)
 Deletes an indexed entry. If you just want to update an entry, simply use IndexObject. More...
 
Promise< IndexResultGetObject (string objectId)
 Fetches a previously indexed object. More...
 
Promise< DoneIndexObject (string objectId, Bundle properties, Bundle payload)
 Indexes a new object. Use this API to add or update an object in an index. You can have as many indexes as you need: one for gamer properties, one for matches, one for finished matches, etc. It only depends on what you want to search for. More...
 
Promise< IndexSearchResultSearch (string query, List< string > sortingProperties=null, int limit=30, int offset=0)
 Searches the index. More...
 
Promise< IndexSearchResultSearchExtended (Bundle query, int limit=30, int offset=0)
 Alternative search function (see Search for more information) that takes a bundle as a search criteria. More...
 

Member Function Documentation

◆ DeleteObject()

Promise<Done> CotcSdk.CloudIndexing.DeleteObject ( string  objectId)

Deletes an indexed entry. If you just want to update an entry, simply use IndexObject.

Returns
Promise resolved when the request has finished.
Parameters
objectIdID of the object to delete, as passed when indexing.

◆ GetObject()

Promise<IndexResult> CotcSdk.CloudIndexing.GetObject ( string  objectId)

Fetches a previously indexed object.

Returns
Promise resolved when the request has finished.
Parameters
objectIdID of the object to look for, as passed when indexing.

◆ IndexObject()

Promise<Done> CotcSdk.CloudIndexing.IndexObject ( string  objectId,
Bundle  properties,
Bundle  payload 
)

Indexes a new object. Use this API to add or update an object in an index. You can have as many indexes as you need: one for gamer properties, one for matches, one for finished matches, etc. It only depends on what you want to search for.

Returns
Promise resolved when the request has finished.
Parameters
objectIdThe ID of the object to be indexed. It can be anything; this ID only needs to uniquely identify your document. Therefore, using the match ID to index a match is recommended for instance.
propertiesA freeform object, whose attributes will be indexed and searchable. These properties are typed! So if 'age' is once passed as an int, it must always be an int, or an error will be thrown upon insertion.
payloadAnother freeform object. These properties are attached to the document in the same way as the properties, however those are not indexed (cannot be looked for in a search request). Its content is returned in searches (CotcSdk.IndexResult.Payload property).

◆ Search()

Promise<IndexSearchResult> CotcSdk.CloudIndexing.Search ( string  query,
List< string >  sortingProperties = null,
int  limit = 30,
int  offset = 0 
)

Searches the index.

You can search documents in the index with this API. It allows you to make complex queries. See the Elastic documentation to learn the full syntax. It’s easy and quite powerful. http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

Returns
Promise resolved when the operation has finished. The attached object contains various information about the results, including a Hits member, which handles the results in a paginated way.
Parameters
queryQuery string. Example: "item:silver". See Elastic documentation.
sortingPropertiesName of properties (fields) to sort the results with. Example: new List<string>() { "item:asc" }.
limitThe maximum number of results to return per page.
offsetNumber of the first result.

◆ SearchExtended()

Promise<IndexSearchResult> CotcSdk.CloudIndexing.SearchExtended ( Bundle  query,
int  limit = 30,
int  offset = 0 
)

Alternative search function (see Search for more information) that takes a bundle as a search criteria.

It allows using the full Elastic search capabilities with full query DSL search. The query bundle represents the JSON document as documented here: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html

Returns
Promise resolved when the operation has finished. The attached object contains various information about the results, including a Hits member, which handles the results in a paginated way.
Parameters
querySearch query as described in the summary.
limitThe maximum number of results to return per page.
offsetNumber of the first result.