![]() |
CloudBuilder C++ SDK
v3.0.0
Making social games is easy !
|
#include <CIndexManager.h>
Public Member Functions | |
void | DeleteObject (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
void | FetchObject (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
void | IndexObject (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
void | Search (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
Static Public Member Functions | |
static CIndexManager * | Instance () |
Friends | |
class | CClan |
struct | singleton_holder< CIndexManager > |
The CIndexManager class is used to index and search for objects (e.g. matches, players, ?).
The index is global to a domain (or your game if private, as usual), therefore all data is shared by all players.
You can index arbitrary data and then look for it using either the properties or the payload. The properties are indexed, while the payload is only returned in the results.
For instance, if you would like to look for matches using certain criteria, such as only "public" matches involving "team B", you will not store these properties in the matches themselves since they are not indexed, but instead index the matches under a "matches" index, along with these properties, and then perform a query to find them. Note that you may need server-side hooks in order to keep the index updated as the match gets modified (if you are indexing, for instance, the number of players, you will want to override the match-join and match-leave events). Refer to the server documentation for more info.
void CloudBuilder::CIndexManager::DeleteObject | ( | const CotCHelpers::CHJSON * | aConfiguration, |
CResultHandler * | aHandler | ||
) |
Deletes an indexed entry. If you just want to update an entry, simply use IndexObject.
aHandler | result handler whenever the call finishes (it might also be synchronous) |
aConfiguration | JSON data describing the indexed data to remove
|
void CloudBuilder::CIndexManager::FetchObject | ( | const CotCHelpers::CHJSON * | aConfiguration, |
CResultHandler * | aHandler | ||
) |
Fetches a previously indexed object.
aHandler | result handler whenever the call finishes (it might also be synchronous) |
aConfiguration | JSON data describing the indexed data to retrieve
|
void CloudBuilder::CIndexManager::IndexObject | ( | const CotCHelpers::CHJSON * | aConfiguration, |
CResultHandler * | aHandler | ||
) |
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.
aHandler | result handler whenever the call finishes (it might also be synchronous) |
aConfiguration | JSON data describing the data to be indexed
|
|
static |
Use this method to obtain a reference to the CIndexManager.
void CloudBuilder::CIndexManager::Search | ( | const CotCHelpers::CHJSON * | aConfiguration, |
CResultHandler * | aHandler | ||
) |
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
aHandler | result handler whenever the call finishes (it might also be synchronous) |
aConfiguration | JSON data describing the data to be indexed
|