# Indexing / querying on calendar data

**URL:** <https://discuss.elastic.co/t/indexing-querying-on-calendar-data/57258>\
**Category:** Elasticsearch\
**Created:** [August 4, 2016, 4:49pm UTC](https://discuss.elastic.co/t/indexing-querying-on-calendar-data/57258 "2016-08-04T16:49:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joora](https://avatars.discourse-cdn.com/v4/letter/j/7ab992/32.png) [@joora](https://discuss.elastic.co/u/joora)\
**Post date:** [August 4, 2016, 4:49pm UTC](https://discuss.elastic.co/t/indexing-querying-on-calendar-data/57258/1 "2016-08-04T16:49:05Z")

</div>

Hi!

I'm trying to use elasticsearch with symfony and elastica, for the first time.  
I hope to receive good avises here 🙂

Basically, I have a sort of calendar with users participating to events:

- users
- events (with date start, date end, and status\*)
- places (name)

Relationship:  
users \<n,m\> events \<1,1\> places

\*status = attribute of the user-event relation.

I need to get users listing, with events/places criterias, like:

- users participating with "OK" status on event of place "X" from date Y do date Z.
- users not having participated to any event on the last X months
- users with more than 50% of status "canceled" on evens for the lase X months  
...

So, what would be the best for indexing:

- nesting user-events
- nesting places or flattering place name into events?

And how to make the corresponding queries?

Thanks!  
joora

---

<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, 10:30pm UTC](https://discuss.elastic.co/t/indexing-querying-on-calendar-data/57258/2 "2017-07-05T22:30:01Z")

</div>

Closed on July 5, 2017, 10:30pm UTC


