![]() |
CotC C# SDK for Unity
v1.4.0.1
Making social games is easy !
|
Provides an API allowing to manipulate an index.
Public Member Functions | |
Promise< Done > | DeleteObject (string objectId) |
Deletes an indexed entry. If you just want to update an entry, simply use IndexObject. More... | |
Promise< IndexResult > | GetObject (string objectId) |
Fetches a previously indexed object. More... | |
Promise< Done > | 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. More... | |
Promise< IndexSearchResult > | Search (string query, List< string > sortingProperties=null, int limit=30, int offset=0) |
Searches the index. More... | |
Promise< IndexSearchResult > | 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. More... | |
Deletes an indexed entry. If you just want to update an entry, simply use IndexObject.
objectId | ID of the object to delete, as passed when indexing. |
Promise<IndexResult> CotcSdk.CloudIndexing.GetObject | ( | string | objectId | ) |
Fetches a previously indexed object.
objectId | ID of the object to look for, as passed when indexing. |
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.
objectId | The 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. |
properties | A 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. |
payload | Another 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). |
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
query | Query string. Example: "item:silver". See Elastic documentation. |
sortingProperties | Name of properties (fields) to sort the results with. Example: new List<string>() { "item:asc" }. |
limit | The maximum number of results to return per page. |
offset | Number of the first result. |
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
query | Search query as described in the summary. |
limit | The maximum number of results to return per page. |
offset | Number of the first result. |