# What should be the mapping/data model of my documents?

**URL:** <https://discuss.elastic.co/t/what-should-be-the-mapping-data-model-of-my-documents/2149>\
**Category:** Elasticsearch\
**Created:** [June 8, 2015, 3:51pm UTC](https://discuss.elastic.co/t/what-should-be-the-mapping-data-model-of-my-documents/2149 "2015-06-08T15:51:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_Wisser](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@Jean\_Wisser](https://discuss.elastic.co/u/Jean_Wisser)\
**Post date:** [June 8, 2015, 3:51pm UTC](https://discuss.elastic.co/t/what-should-be-the-mapping-data-model-of-my-documents/2149/1 "2015-06-08T15:51:09Z")

</div>

Hello everyone !

I'm currently parsing text from internal résumés in my company. The goal is to index everything in elasticsearch to perform search on them.

for the moment I have the following JSON document (= resume) :

Each **coworker** has a list of **project** with the **client** name

```
{
name: "Jean Wisser"
position: "Junior Developer"
age: 24
"projects": [
        {
            "client": "SutrixMedia",
            "location": "Ho Chi Minh, Vietnam",
            "dates": "Mai à Septembre 2015",
            "project": "Web sites creation",
            "role": "Project Manager",
            "missions": [
                "Responsible for the quality on time and within budget",
                "Writing specs, testing,..."
            ],
            "env": "JIRA/Mantis/Adobe CQ5 (AEM)"
        },
        {
            "client": "Société Générale",
            "localisation": "Luxembourg, Luxembourg",
            "dates": "Mai à Septembre 2015",
            "projet": "UAT Testing",
            "role": "Business analyst",
            "missions": [
                " Writing test cases and scenarios",
                " UAT"],
            "env": "HP QTP/QC"
        }
    ],
    "comp_tech": [" JAVA/JEE"," Web : PHP, HTML","QlickSense · Qlikview"," HP QTP/QC"," SQL","MySQL","Sybase"],
    "comp_fonct": ["Banking", "Pharmaceutical"]
}

```

The 2 main questions we would like to answer are :

1. Which coworker has already worked in this company ?
2. Which client use this technology ?

The first question is really easy, for example:

1. `Projects.client="SutrixMedia"` returns me the right resume

But how can I answer to the second one ?

Should I define some mapping for the nested elements or should I create 3 different type of documents : coworker, project, and client with foreign keys ?  
What is your advice ?

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:09am UTC](https://discuss.elastic.co/t/what-should-be-the-mapping-data-model-of-my-documents/2149/2 "2017-07-06T00:09:00Z")

</div>


