D
D
dark_spectator2019-05-03 19:34:10
elasticsearch
dark_spectator, 2019-05-03 19:34:10

Storing data in ElasticSearch?

I use ElasticSearch as my main data store. The question is how to store additional information about the user in it.
There are currently 2 indexes

socket-apps-db : {
   users: {
      "user_id" : {
         "login" : "user_login",
         "email": "user_email",
         "password" : "user_password",
      }
   }
}

socket-apps-{game_name}-cloud : { // {game_name} - Название игры, для которой облако

  "data" : {
  "user_id" : {
    "level" : 5,
    "cloud": "{cloud_data}"
}
}

}

I also plan to store the user's friends and messages, for each dialogue there is a separate index, for the list of user's friends too. IDs are stored in Redis.
The question is, am I doing it right?
It is desirable to create several types for these things in 1 index, but ElasticSearch says that only 1 type per index.
Or how to implement such a structure in general and what bases/tools to use?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2019-05-03
@dark_spectator

It is not necessary to store the main database there - this is a search engine, and not a normal database, after all) it is not suitable for this. But if you feel like it, then treat it like it's document-oriented

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question