# How to specify value for "attdate" within search?

**URL:** <https://forum.xwiki.org/t/how-to-specify-value-for-attdate-within-search/7873>\
**Category:** Help / Discuss\
**Created:** [December 2, 2020, 11:21am UTC](https://forum.xwiki.org/t/how-to-specify-value-for-attdate-within-search/7873 "2020-12-02T11:21:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NorSch](https://forum.xwiki.org/user_avatar/forum.xwiki.org/norsch/32/3116_2.png) [@NorSch](https://forum.xwiki.org/u/NorSch)\
**Post date:** [December 2, 2020, 11:21am UTC](https://forum.xwiki.org/t/how-to-specify-value-for-attdate-within-search/7873/1 "2020-12-02T11:21:58Z")

</div>

While restricting search on attachments you can specify fields like “filename”,“attauthor\_display” even with wildcard. That works fine.  
But I didn’t find the correct syntax for specifying any “attdate” value (date when the last version of the attachment was uploaded).

Is it possible at all?

There is an additional question: Is it possible to specify a date range ?

Thanks

---

<div class="post-metadata">

**Author:** ![NorSch](https://forum.xwiki.org/user_avatar/forum.xwiki.org/norsch/32/3116_2.png) [@NorSch](https://forum.xwiki.org/u/NorSch)\
**Post date:** [December 15, 2020, 7:21pm UTC](https://forum.xwiki.org/t/how-to-specify-value-for-attdate-within-search/7873/2 "2020-12-15T19:21:42Z")

</div>

In the meantime I found the information I was looking for.

This helps:

`range -> attdate:[2020-12-01T00:00:00.000Z TO 2020-12-02T23:59:59.999Z]`

```
/HOUR 
/DAY 
/MONTH 
/YEAR round to the beginning of hour,day,month,year

```

with rounding `attdate:[2020-12-20T12:34:56.789Z/MONTH TO 2020-01-31T23:59:59.999Z]`

```
today -> attdate:[NOW-1DAY/DAY TO *]
yesterday -> attdate:[NOW-1DAY/DAY TO NOW/DAY]
last month -> attdate:[NOW-1MONTH/MONTH TO NOW/MONTH]
last year -> attdate:[NOW-1YEAR/YEAR TO NOW/YEAR]

```

all pdf attachments uploaded yesterday`

> `mimetype:application/pdf && attdate:[NOW-1DAY/DAY TO NOW/DAY]`

This link helped: [Working with Dates | Apache Solr Reference Guide 6.6](https://lucene.apache.org/solr/guide/6_6/working-with-dates.html#working-with-dates)

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [December 16, 2020, 11:08am UTC](https://forum.xwiki.org/t/how-to-specify-value-for-attdate-within-search/7873/3 "2020-12-16T11:08:38Z")

</div>

> [@NorSch](#):
>
> In the meantime I found the information I was looking for.

Thanks for posting back, quite useful!

Would be awesome to add this info to [https://extensions.xwiki.org/xwiki/bin/view/Extension/Solr%20Search%20Application#HSearchSyntax](https://extensions.xwiki.org/xwiki/bin/view/Extension/Solr%20Search%20Application#HSearchSyntax) IMO (don’t hesitate to add it, it’s a wiki ;)).

Thanks a lot
