Class: Ferret::Search::Spans::SpanMultiTermQuery
Summary
A SpanMultiTermQuery is the Spans version of MultiTermQuery, the only difference being that it returns the start and end offset of all of its matches for use by enclosing SpanQueries.
Public Class Methods
SpanMultiTermQuery.new(field, terms) → query
Create a new SpanMultiTermQuery which matches all documents with the terms terms in the field field. terms should be an array of Strings.
/*
* call-seq:
* SpanMultiTermQuery.new(field, terms) -> query
*
* Create a new SpanMultiTermQuery which matches all documents with the terms
* +terms+ in the field +field+. +terms+ should be an array of Strings.
*/
static VALUE
frb_spanmtq_init(VALUE self, VALUE rfield, VALUE rterms)
{
Query *q = spanmtq_new(frb_field(rfield));
int i;
for (i = RARRAY(rterms)->len - 1; i >= 0; i--) {
spanmtq_add_term(q, StringValuePtr(RARRAY(rterms)->ptr[i]));
}
Frt_Wrap_Struct(self, NULL, &frb_q_free, q);
object_add(q, self);
return self;
}