Module: Ferret

Defined in:
ext/ferret.c,
lib/ferret_version.rb,
lib/ferret/document.rb,
ext/ferret.c,
lib/ferret/index.rb

Overview

See the README

Defined Under Namespace

Modules: Analysis, BoostMixin, Browser, Index, Search, Store, Utils Classes: Document, Field, FileNotFoundError, ParseError, QueryParser, StateError, Term

Constant Summary collapse

VERSION =
'0.11.6.3'
OBJECT_SPACE =
object_space
EXCEPTION_MAP =
error_map
FIX_INT_MAX =
INT2FIX(INT_MAX >> 1)
I =
Index::Index

Class Method Summary collapse

Class Method Details

.localeObject

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

puts Ferret.locale #=> "en_US.UTF-8"


1594
1595
1596
1597
# File 'ext/r_analysis.c', line 1594

static VALUE frt_get_locale(VALUE self, VALUE locale)
{
    return (frt_locale ? rb_str_new2(frt_locale) : Qnil);
}

.locale=(locale) ⇒ Object

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



1606
1607
1608
1609
1610
1611
# File 'ext/r_analysis.c', line 1606

static VALUE frt_set_locale(VALUE self, VALUE locale)
{
    char *l = ((locale == Qnil) ? NULL : rs2s(rb_obj_as_string(locale)));
    frt_locale = setlocale(LC_CTYPE, l);
    return frt_locale ? rb_str_new2(frt_locale) : Qnil;
}