Raj Singh
2007-Sep-11 14:23 UTC
[Ferret-talk] How to search with range when I am using AAF
acts_as_ferret :fields => {
:name => {:},
:desc => {},
:start_date => {}
}
def start_date
self.start_datetime.strftime("%Y%m%d")
end
Now that I am strong start_date in YYYYMMDD format, I want to search for
all event in between 20070506 and 20070809
What will my query look like when I am using aaf. This one doesn''t work
Event.find_id_by_contents("start_date:[20070506 20070809])
I know how it works with native Ferret but can''t seem to integrate with
aaf.
--
Posted via http://www.ruby-forum.com/.
Doug Smith
2007-Sep-11 15:08 UTC
[Ferret-talk] How to search with range when I am using AAF
For what it''s worth, a similar query works for me:
Article.find_by_contents("published_on:[2007-06-04 2007-09-14]")
My published_on field is a DATE in the database, and I don''t convert
it at all. I''m using Ferret 0.11.4 and the latest aaf from the svn
trunk.
Hope that helps,
Doug
On 9/11/07, Raj Singh <neeraj.jsr at gmail.com>
wrote:> acts_as_ferret :fields => {
> :name => {:},
> :desc => {},
> :start_date => {}
> }
>
>
> def start_date
> self.start_datetime.strftime("%Y%m%d")
> end
>
>
> Now that I am strong start_date in YYYYMMDD format, I want to search for
> all event in between 20070506 and 20070809
>
> What will my query look like when I am using aaf. This one doesn''t
work
> Event.find_id_by_contents("start_date:[20070506 20070809])
>
> I know how it works with native Ferret but can''t seem to integrate
with
> aaf.
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ferret-talk mailing list
> Ferret-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ferret-talk
>
Raj Singh
2007-Sep-12 22:03 UTC
[Ferret-talk] How to search with range when I am using AAF
Doug: You are right. For some mysterious reason I wasn''t getting the result. It''s all good now. Thanks. Doug Smith wrote:> For what it''s worth, a similar query works for me: > > Article.find_by_contents("published_on:[2007-06-04 2007-09-14]") > > My published_on field is a DATE in the database, and I don''t convert > it at all. I''m using Ferret 0.11.4 and the latest aaf from the svn > trunk. > > Hope that helps, > > Doug-- Posted via http://www.ruby-forum.com/.