# Lucene (Or KQL) query to filter current day of week

**URL:** <https://discuss.elastic.co/t/lucene-or-kql-query-to-filter-current-day-of-week/306339>\
**Category:** Elasticsearch\
**Created:** [June 3, 2022, 1:06pm UTC](https://discuss.elastic.co/t/lucene-or-kql-query-to-filter-current-day-of-week/306339 "2022-06-03T13:06:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vincent2mots](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vincent2mots/32/55226_2.png) [@vincent2mots](https://discuss.elastic.co/u/vincent2mots)\
**Post date:** [June 3, 2022, 1:06pm UTC](https://discuss.elastic.co/t/lucene-or-kql-query-to-filter-current-day-of-week/306339/1 "2022-06-03T13:06:38Z")

</div>

Hi there!

I have some data on Elasticsearch with a datetime field.

I would like to filter all the data where the dayofweek is the same as today's... this way, I would be able to get all friday's data, saturday's data, etc dynamically. (eg without changing the day of week each day)

I try a lot of things but I'm stuck...

In discover, I tried the following query expression (in Lucene) :

> my\_index\_field.dayofweek= **now.dayOfWeek**

Of course, it doesn't recognize the **now.dayOfWeek**

Is is only possible to achieve something like that?

Best regards,

---

<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 1, 2022, 1:06pm UTC](https://discuss.elastic.co/t/lucene-or-kql-query-to-filter-current-day-of-week/306339/2 "2022-07-01T13:06:45Z")

</div>

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