Module: Ferret

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

Overview

See the README

Defined Under Namespace

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

Constant Summary collapse

VERSION =
'0.11.8.7'
FIELD_TYPES =
%w(integer float string byte).map{|t| t.to_sym}
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"


1685
1686
1687
1688
# File 'ext/r_analysis.c', line 1685

static VALUE frb_get_locale(VALUE self, VALUE locale)
{
    return (frb_locale ? rb_str_new2(frb_locale) : Qnil);
}

.locale=(locale) ⇒ Object

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



1697
1698
1699
1700
1701
1702
# File 'ext/r_analysis.c', line 1697

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;
}