Hello. I need to implement the following task using elasticsearch and Java API to this database: there is a type "user" with the id "womens" and in it I need to add, for example, 2 users with data. It should look something like this:

{ "_index": "company", "_type": "users", "_id": "womens", "_source": {[ "Alisa: "{ "old": "20", "married": "no" }, "Tatiana: "{ "old": 25, "married": "yes" } ]} } 

In the future, I will need to receive all users or a specific one of them by some parameter from the type of "users" by id "womens", as well as update and delete this data. I could not google the solution, so I am writing here. I would be grateful for any help.

  • You cannot search inside the document; you can either pull out the womens or not. And, by the way, women is already a plural number. - etki
  • Is it possible to somehow solve the problem described? - PREDATORik
  • one
    No, as long as you store the data in one document. You must have different documents with sex: male / female attributes. - etki
  • thanks for the answer. about women agree, just head tight thinking at the end of the day. - PREDATORik

0