/* * call-seq: * SpanOrQuery.new(options = {}) -> query * * Create a new SpanOrQuery. This is just like a BooleanQuery with all * clauses with the occur value of :should. The difference is that it can be * passed to other SpanQuerys like SpanNearQuery. */ static VALUE frt_spanoq_init(int argc, VALUE *argv, VALUE self) { Query *q; VALUE rclauses; q = spanoq_new(); if (rb_scan_args(argc, argv, "01", &rclauses) > 0) { int i; Query *clause; Check_Type(rclauses, T_ARRAY); for (i = 0; i < RARRAY(rclauses)->len; i++) { Data_Get_Struct(RARRAY(rclauses)->ptr[i], Query, clause); spanoq_add_clause(q, clause); } } Frt_Wrap_Struct(self, &frt_spanoq_mark, &frt_q_free, q); object_add(q, self); return self; }