# Ferret::Search::TypedRangeQuery

**URL:** <https://www.ruby-forum.com/t/ferret-typedrangequery/156544>\
**Category:** Ferret\
**Created:** [December 29, 2008, 8:52pm UTC](https://www.ruby-forum.com/t/ferret-typedrangequery/156544 "2008-12-29T20:52:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dur\_dev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f475e1/32.png) [@dur\_dev](https://www.ruby-forum.com/u/dur_dev)\
**Post date:** [December 29, 2008, 8:52pm UTC](https://www.ruby-forum.com/t/ferret-typedrangequery/156544/1 "2008-12-29T20:52:38Z")

</div>

I need to do typed range queries on record ids and dates. When I call  
Ferret::Search::TypedRangeQuery I get the error:

NameError: uninitialized constant Ferret::Search::TypedRangeQuery

Is TypedRangeQuery supported in AAF? I am using Ferret gem 0.11.6 and  
AAF 0.4.3. If its not supported, is there any other way of accomplishing  
a typed range query? I tried using a RangeQuery and setting the  
following in the model:

acts\_as\_ferret :fields =\> { :id\_sort =\> { :index =\> :untokenized },  
:updated\_at\_sort =\> { :index =\> :untokenized }, …}, :ferret =\> {  
:use\_typed\_range\_query =\> true }

…but this didn’t work either. The search results indicate ferret is  
treating the ids as strings. It seem to do the correct thing with date  
ranges however.

---

<div class="post-metadata">

**Author:** ![dur\_dev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f475e1/32.png) [@dur\_dev](https://www.ruby-forum.com/u/dur_dev)\
**Post date:** [December 31, 2008, 8:21pm UTC](https://www.ruby-forum.com/t/ferret-typedrangequery/156544/2 "2008-12-31T20:21:42Z")

</div>

Dur Dev wrote:

> I need to do typed range queries on record ids and dates. When I call  
> Ferret::Search::TypedRangeQuery I get the error:
> 
> NameError: uninitialized constant Ferret::Search::TypedRangeQuery
> 
> Is TypedRangeQuery supported in AAF? I am using Ferret gem 0.11.6 and  
> AAF 0.4.3. If its not supported, is there any other way of accomplishing  
> a typed range query? I tried using a RangeQuery and setting the  
> following in the model:
> 
> acts\_as\_ferret :fields =\> { :id\_sort =\> { :index =\> :untokenized },  
> :updated\_at\_sort =\> { :index =\> :untokenized }, …}, :ferret =\> {  
> :use\_typed\_range\_query =\> true }
> 
> …but this didn’t work either. The search results indicate ferret is  
> treating the ids as strings. It seem to do the correct thing with date  
> ranges however.

Looks like it’s not supported in 0.11.6. It’s in “current”. Nice  
feature, look forward to using it when it’s released.
