### Home Classes Methods

### In Files

- ext/r_search.c

### Parent

cFilter

### Methods

- ::new

### Files

- MIT-LICENSE
- README
- TODO
- TUTORIAL

### Class/Module Index

Quicksearch

- Ferret
- Ferret::BlankSlate
- Ferret::BoostMixin
- Ferret::Browser
- Ferret::Browser::Controller
- Ferret::Browser::Delegator
- Ferret::Browser::DocumentController
- Ferret::Browser::ErrorController
- Ferret::Browser::HelpController
- Ferret::Browser::HomeController
- Ferret::Browser::TermController
- Ferret::Browser::TermVectorController
- Ferret::Browser::ViewHelper
- Ferret::Document
- Ferret::Field
- Ferret::FieldSymbol
- Ferret::FieldSymbolMethods
- Ferret::FileNotFoundError
- Ferret::Index
- Ferret::Index::FieldInfo
- Ferret::Index::FieldInfos
- Ferret::Index::Index
- Ferret::Index::IndexReader
- Ferret::Index::IndexWriter
- Ferret::Index::LazyDoc
- Ferret::Index::LazyDoc::LazyDocData
- Ferret::Index::TermDocEnum
- Ferret::Index::TermEnum
- Ferret::Index::TermVector
- Ferret::Index::TermVector::TVOffsets
- Ferret::Index::TermVector::TVTerm
- Ferret::ParseError
- Ferret::QueryParser
- Ferret::QueryParser::QueryParseException
- Ferret::Search
- Ferret::Search::BooleanQuery
- Ferret::Search::BooleanQuery::BooleanClause
- Ferret::Search::ConstantScoreQuery
- Ferret::Search::Explanation
- Ferret::Search::Filter
- Ferret::Search::FilteredQuery
- Ferret::Search::FuzzyQuery
- Ferret::Search::Hit
- Ferret::Search::MatchAllQuery
- Ferret::Search::MultiSearcher
- Ferret::Search::MultiTermQuery
- Ferret::Search::PhraseQuery
- Ferret::Search::PrefixQuery
- Ferret::Search::Query
- Ferret::Search::QueryFilter
- Ferret::Search::RangeFilter
- Ferret::Search::RangeQuery
- Ferret::Search::Searcher
- Ferret::Search::Sort
- Ferret::Search::SortField
- Ferret::Search::Spans
- Ferret::Search::Spans::SpanFirstQuery
- Ferret::Search::Spans::SpanMultiTermQuery
- Ferret::Search::Spans::SpanNearQuery
- Ferret::Search::Spans::SpanNotQuery
- Ferret::Search::Spans::SpanOrQuery
- Ferret::Search::Spans::SpanPrefixQuery
- Ferret::Search::Spans::SpanTermQuery
- Ferret::Search::TermQuery
- Ferret::Search::TopDocs
- Ferret::Search::TypedRangeFilter
- Ferret::Search::TypedRangeQuery
- Ferret::Search::WildcardQuery
- Ferret::StateError
- Ferret::Store
- Ferret::Store::Directory
- Ferret::Store::FSDirectory
- Ferret::Store::Lock
- Ferret::Store::Lock::LockError
- Ferret::Store::RAMDirectory
- WEBrick
- WEBrick::FerretBrowserHandler
- Date
- DateTime
- FileUtils
- Float
- Integer
- String
- Symbol
- Time

No matching classes.

# Ferret::Search::RangeFilter

## Summary

RangeFilter filters a set of documents which contain a lexicographical range of terms (ie "aaa", "aab", "aac", etc). See also RangeQuery

## Example

Find all documents created before 5th of September 2002.

    filter = RangeFilter.new(:created_on, :< => "20020905")

## Number fields

See RangeQuery for notes on how to use the RangeFilter on a field containing numbers.

### Public Class Methods

new(field, options = {}) → range_query click to toggle source

Create a new RangeFilter on field `field`. There are two ways to build a range filter. With the old-style options; `:lower`, `:upper`, `:include_lower` and `:include_upper` or the new style options; +:<+, +:<=+, +:>+ and +:>=+. The options' names should speak for themselves. In the old-style options, limits are inclusive by default.

## Examples

    f = RangeFilter.new(:date, :lower => "200501", :include_lower => false)
    # is equivalent to
    f = RangeFilter.new(:date, :< => "200501")
    # is equivalent to
    f = RangeFilter.new(:date, :lower_exclusive => "200501")

    f = RangeFilter.new(:date, :lower => "200501", :upper => 200502)
    # is equivalent to
    f = RangeFilter.new(:date, :>= => "200501", :<= => 200502)

    static VALUE
    frb_rf_init(VALUE self, VALUE rfield, VALUE roptions)
    {
        Filter *f;
        char *lterm = NULL;
        char *uterm = NULL;
        bool include_lower = false;
        bool include_upper = false;

        get_range_params(roptions, &lterm, &uterm, &include_lower, &include_upper);
        f = rfilt_new(frb_field(rfield), lterm, uterm,
                      include_lower, include_upper);
        Frt_Wrap_Struct(self, NULL, &frb_f_free, f);
        object_add(f, self);
        return self;
    }

[Validate]

Generated with the Darkfish Rdoc Generator 2.