# Attributes: Filters, Aggregations?

**URL:** <https://discuss.elastic.co/t/attributes-filters-aggregations/46129>\
**Category:** Elasticsearch\
**Created:** [April 2, 2016, 10:41am UTC](https://discuss.elastic.co/t/attributes-filters-aggregations/46129 "2016-04-02T10:41:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BenSeb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benseb/32/8714_2.png) [@BenSeb](https://discuss.elastic.co/u/BenSeb)\
**Post date:** [April 2, 2016, 10:41am UTC](https://discuss.elastic.co/t/attributes-filters-aggregations/46129/1 "2016-04-02T10:41:19Z")

</div>

Hi

We wish to index physical events as documents. Each event will have multiple attributes, such as artists who are attending, and dates.

We're migrating from Sphinx, and to deal with this, we produced a mysql query which produced a single row, with some columns containing the attributes, eg:

```
   |id |name | artists |
   |001 | event 1 | artist1 artist2 artist3 |
   |002 | event 2 | artist1 artist4 artist9 |

```

Could someone point me in the correct direction for doing this with ES? I can replicate the same layout and it will perform a search query, but I want to be able to use filters, etc to pull out all 'events with artist 1' for example

Many thanks

---

<div class="post-metadata">

**Author:** ![BenSeb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benseb/32/8714_2.png) [@BenSeb](https://discuss.elastic.co/u/BenSeb)\
**Post date:** [April 2, 2016, 10:43am UTC](https://discuss.elastic.co/t/attributes-filters-aggregations/46129/2 "2016-04-02T10:43:20Z")

</div>

ps, I will be using Logstash/JDBC to import the records via Mysql

---

<div class="post-metadata">

**Author:** ![JoarSvensson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joarsvensson/32/8740_2.png) [@JoarSvensson](https://discuss.elastic.co/u/JoarSvensson)\
**Post date:** [April 4, 2016, 10:45am UTC](https://discuss.elastic.co/t/attributes-filters-aggregations/46129/3 "2016-04-04T10:45:08Z")

</div>

Hi, so the question is how to do filter queries with Elasticsearch?

```
GET /_search
{
    "query": {
        "filtered": {
            "filter": { "term": { "artists": "artist1" }}
        }
    }
}

```

More examples at [https://www.elastic.co/guide/en/elasticsearch/guide/current/\_combining\_queries\_with\_filters.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/_combining_queries_with_filters.html)

---

<div class="post-metadata">

**Author:** ![BenSeb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benseb/32/8714_2.png) [@BenSeb](https://discuss.elastic.co/u/BenSeb)\
**Post date:** [April 5, 2016, 3:52pm UTC](https://discuss.elastic.co/t/attributes-filters-aggregations/46129/4 "2016-04-05T15:52:14Z")

</div>

Hi

No, it was more how to store the data - should I be storing each artist as a nested attribute in the index?

---

<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 5, 2017, 11:02pm UTC](https://discuss.elastic.co/t/attributes-filters-aggregations/46129/5 "2017-07-05T23:02:12Z")

</div>


