Module: Ferret

Document-module: Ferret

See the README

Child modules and classes

Module Ferret::Analysis
Module Ferret::BoostMixin
Module Ferret::Browser
Module Ferret::FieldSymbolMethods
Module Ferret::Index
Module Ferret::QueryParser
Module Ferret::Search
Module Ferret::Store
Module Ferret::Utils
Class Ferret::BlankSlate
Class Ferret::Document
Class Ferret::Field
Class Ferret::FieldSymbol
Class Ferret::FileNotFoundError
Class Ferret::ParseError
Class Ferret::QueryParser
Class Ferret::StateError

Constants

NameValue
FIELD_TYPES %w(integer float string byte).map{|t| t.to_sym}
I Index::Index
VERSION '0.11.8'
OBJECT_SPACE object_space
EXCEPTION_MAP error_map
FIX_INT_MAX INT2FIX(INT_MAX >> 1)

Public Class Methods


Ferret.locale → locale_str

Returns a string corresponding to the locale set. For example;

   puts Ferret.locale #=> "en_US.UTF-8"
/*
 *  call-seq:
 *     Ferret.locale -> locale_str
 *
 *  Returns a string corresponding to the locale set. For example;
 *
 *     puts Ferret.locale #=> "en_US.UTF-8"
 */
static VALUE frb_get_locale(VALUE self, VALUE locale)
{
    return (frb_locale ? rb_str_new2(frb_locale) : Qnil);
}

Ferret.locale = "en_US.UTF-8"

Set the global locale. You should use this method to set different locales when indexing documents with different encodings.

/*
 *  call-seq:
 *     Ferret.locale = "en_US.UTF-8"
 *
 *  Set the global locale. You should use this method to set different locales
 *  when indexing documents with different encodings.
 */
static VALUE frb_set_locale(VALUE self, VALUE locale)
{
    char *l = ((locale == Qnil) ? NULL : rs2s(rb_obj_as_string(locale)));
    frb_locale = setlocale(LC_CTYPE, l);
    return frb_locale ? rb_str_new2(frb_locale) : Qnil;
}