# Mapping Strategies For Survey Data

**URL:** <https://discuss.elastic.co/t/mapping-strategies-for-survey-data/291481>\
**Category:** Logstash\
**Created:** [December 10, 2021, 11:07pm UTC](https://discuss.elastic.co/t/mapping-strategies-for-survey-data/291481 "2021-12-10T23:07:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [December 10, 2021, 11:07pm UTC](https://discuss.elastic.co/t/mapping-strategies-for-survey-data/291481/1 "2021-12-10T23:07:23Z")

</div>

I am ingesting data and looking for opinions on better ways of indexing the data for later aggregation analytics. The data is currently pulled and stored in Elasticsearch as numbered q&a fields.

```auto
{
  "question1": {
    "question": "How are you?",
    "answer": "Pumpkin Pie"
  }
},
{
  "question2": {
    "question": "What's your favorite color?",
    "answer": "Bowling ball"
  }
}

```

The problems I am seeing with this strategy is, there's no easy way to create a Kibana visualization, that I know of, that aggregates all the questions and/or answers to answer things like "How many times is the question, 'How are you' asked?" Or a way to filter on a specific question without having to know it's 'question246'. I thought maybe I could join all the questions/answers asked into a single field of arrays, but I'm not sure how I'd go about joining a non-contiguous N number of fields like that together via Logstash.

Any thoughts on a better way to organize the data?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [December 11, 2021, 12:40am UTC](https://discuss.elastic.co/t/mapping-strategies-for-survey-data/291481/2 "2021-12-11T00:40:15Z")

</div>

How about making each question its own event with [question] and [answer] fields?

---

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [December 13, 2021, 4:58pm UTC](https://discuss.elastic.co/t/mapping-strategies-for-survey-data/291481/3 "2021-12-13T16:58:55Z")

</div>

heh, this is actually related to another post I recently opened that you helped me with. The questions asked are actually part of an event and need to stay with that event.

---

<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:** [January 10, 2022, 4:59pm UTC](https://discuss.elastic.co/t/mapping-strategies-for-survey-data/291481/4 "2022-01-10T16:59:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
