/* * call-seq: * searcher.search(query, options = {}) -> TopDocs * * Run a query through the Searcher on the index. A TopDocs object is * returned with the relevant results. The +query+ is a built in Query * object. Here are the options; * * === Options * * :offset:: Default: 0. The offset of the start of the section of the * result-set to return. This is used for paging through * results. Let's say you have a page size of 10. If you * don't find the result you want among the first 10 results * then set +:offset+ to 10 and look at the next 10 results, * then 20 and so on. * :limit:: Default: 10. This is the number of results you want * returned, also called the page size. Set +:limit+ to * +:all+ to return all results * :sort:: A Sort object or sort string describing how the field * should be sorted. A sort string is made up of field names * which cannot contain spaces and the word "DESC" if you * want the field reversed, all separated by commas. For * example; "rating DESC, author, title". Note that Ferret * will try to determine a field's type by looking at the * first term in the index and seeing if it can be parsed as * an integer or a float. Keep this in mind as you may need * to specify a fields type to sort it correctly. For more * on this, see the documentation for SortField * :filter:: a Filter object to filter the search results with * :filter_proc:: a filter Proc is a Proc which takes the doc_id, the score * and the Searcher object as its parameters and returns * either a Boolean value specifying whether the result * should be included in the result set, or a Float between 0 * and 1.0 to be used as a factor to scale the score of the * object. This can be used, for example, to weight the score * of a matched document by it's age. */ static VALUE frb_sea_search(int argc, VALUE *argv, VALUE self) { GET_SEA(); VALUE rquery, roptions; Query *query; rb_scan_args(argc, argv, "11", &rquery, &roptions); Data_Get_Struct(rquery, Query, query); return frb_get_td(frb_sea_search_internal(query, roptions, sea), self); }