/*
* call-seq:
* FieldInfo.new(name, options = {}) -> field_info
*
* Create a new FieldInfo object with the name +name+ and the properties
* specified in +options+. The available options are [:store, :index,
* :term_vector, :boost]. See the description of FieldInfo for more
* information on these properties.
*/
static VALUE
frt_fi_init(int argc, VALUE *argv, VALUE self)
{
VALUE roptions, rname;
FieldInfo *fi;
enum StoreValues store = STORE_YES;
enum IndexValues index = INDEX_YES;
enum TermVectorValues term_vector = TERM_VECTOR_WITH_POSITIONS_OFFSETS;
float boost = 1.0f;
rb_scan_args(argc, argv, "11", &rname, &roptions);
if (argc > 1) {
frt_fi_get_params(roptions, &store, &index, &term_vector, &boost);
}
fi = fi_new(frt_field(rname), store, index, term_vector);
fi->boost = boost;
Frt_Wrap_Struct(self, NULL, &frt_fi_free, fi);
object_add(fi, self);
return self;
}