# How to search date with ferret and acts\_as\_ferret?

**URL:** <https://www.ruby-forum.com/t/how-to-search-date-with-ferret-and-acts-as-ferret/108689>\
**Category:** Ferret\
**Created:** [July 6, 2007, 1:17am UTC](https://www.ruby-forum.com/t/how-to-search-date-with-ferret-and-acts-as-ferret/108689 "2007-07-06T01:17:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [July 6, 2007, 1:17am UTC](https://www.ruby-forum.com/t/how-to-search-date-with-ferret-and-acts-as-ferret/108689/1 "2007-07-06T01:17:42Z")

</div>

Hey all,

How can I search date with ferret? Do I need to submit them in a special  
format?  
Right now I have in my Item model:

acts\_as\_ferret :fields =\> [:created\_on]

with eg created\_on = Thu May 11 17:00:00 -0500 2006

now when I do Item.find\_by\_content(“created\_on:\<#{Time.now}”)

I get nil, I’m probably doing something wrong.

Any idea how to fix it?

thanx in advance

Pat

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [July 6, 2007, 2:46am UTC](https://www.ruby-forum.com/t/how-to-search-date-with-ferret-and-acts-as-ferret/108689/2 "2007-07-06T02:46:48Z")

</div>

ok found it.

acts\_as\_ferret :fields =\> [:created\_on =\> {:index =\>  
:untokenized\_omit\_norms, :term\_vector =\> :no}]

def created\_on  
self.created\_on.to\_i  
end
