### Home Classes Methods

### In Files

- ext/r_search.c

### Parent

Ferret::Search::Searcher

### Methods

- ::new

### Files

- MIT-LICENSE
- README
- TODO
- TUTORIAL

### Class/Module Index

Quicksearch

- Ferret
- Ferret::BlankSlate
- Ferret::BoostMixin
- Ferret::Browser
- Ferret::Browser::Controller
- Ferret::Browser::Delegator
- Ferret::Browser::DocumentController
- Ferret::Browser::ErrorController
- Ferret::Browser::HelpController
- Ferret::Browser::HomeController
- Ferret::Browser::TermController
- Ferret::Browser::TermVectorController
- Ferret::Browser::ViewHelper
- Ferret::Document
- Ferret::Field
- Ferret::FieldSymbol
- Ferret::FieldSymbolMethods
- Ferret::FileNotFoundError
- Ferret::Index
- Ferret::Index::FieldInfo
- Ferret::Index::FieldInfos
- Ferret::Index::Index
- Ferret::Index::IndexReader
- Ferret::Index::IndexWriter
- Ferret::Index::LazyDoc
- Ferret::Index::LazyDoc::LazyDocData
- Ferret::Index::TermDocEnum
- Ferret::Index::TermEnum
- Ferret::Index::TermVector
- Ferret::Index::TermVector::TVOffsets
- Ferret::Index::TermVector::TVTerm
- Ferret::ParseError
- Ferret::QueryParser
- Ferret::QueryParser::QueryParseException
- Ferret::Search
- Ferret::Search::BooleanQuery
- Ferret::Search::BooleanQuery::BooleanClause
- Ferret::Search::ConstantScoreQuery
- Ferret::Search::Explanation
- Ferret::Search::Filter
- Ferret::Search::FilteredQuery
- Ferret::Search::FuzzyQuery
- Ferret::Search::Hit
- Ferret::Search::MatchAllQuery
- Ferret::Search::MultiSearcher
- Ferret::Search::MultiTermQuery
- Ferret::Search::PhraseQuery
- Ferret::Search::PrefixQuery
- Ferret::Search::Query
- Ferret::Search::QueryFilter
- Ferret::Search::RangeFilter
- Ferret::Search::RangeQuery
- Ferret::Search::Searcher
- Ferret::Search::Sort
- Ferret::Search::SortField
- Ferret::Search::Spans
- Ferret::Search::Spans::SpanFirstQuery
- Ferret::Search::Spans::SpanMultiTermQuery
- Ferret::Search::Spans::SpanNearQuery
- Ferret::Search::Spans::SpanNotQuery
- Ferret::Search::Spans::SpanOrQuery
- Ferret::Search::Spans::SpanPrefixQuery
- Ferret::Search::Spans::SpanTermQuery
- Ferret::Search::TermQuery
- Ferret::Search::TopDocs
- Ferret::Search::TypedRangeFilter
- Ferret::Search::TypedRangeQuery
- Ferret::Search::WildcardQuery
- Ferret::StateError
- Ferret::Store
- Ferret::Store::Directory
- Ferret::Store::FSDirectory
- Ferret::Store::Lock
- Ferret::Store::Lock::LockError
- Ferret::Store::RAMDirectory
- WEBrick
- WEBrick::FerretBrowserHandler
- Date
- DateTime
- FileUtils
- Float
- Integer
- String
- Symbol
- Time

No matching classes.

# Ferret::Search::MultiSearcher

## Summary

See Searcher for the methods that you can use on this object. A MultiSearcher is used to search multiple sub-searchers. The most efficient way to do this would be to open up an IndexReader on multiple directories and creating a Searcher with that. However, if you decide to implement a RemoteSearcher, the MultiSearcher can be used to search multiple machines at once.

### Public Class Methods

new(searcher*) → searcher click to toggle source

Create a new MultiSearcher by passing a list of subsearchers to the constructor.

    static VALUE
    frb_ms_init(int argc, VALUE *argv, VALUE self)
    {
        int i, j, top = 0, capa = argc;

        VALUE rsearcher;
        Searcher **searchers = ALLOC_N(Searcher *, capa);
        Searcher *s;

        for (i = 0; i < argc; i++) {
            rsearcher = argv[i];
            switch (TYPE(rsearcher)) {
                case T_ARRAY:
                    capa += RARRAY_LEN(rsearcher);
                    REALLOC_N(searchers, Searcher *, capa);
                    for (j = 0; j < RARRAY_LEN(rsearcher); j++) {
                        VALUE rs = RARRAY_PTR(rsearcher)[j];
                        Data_Get_Struct(rs, Searcher, s);
                        searchers[top++] = s;
                    }
                    break;
                case T_DATA:
                    Data_Get_Struct(rsearcher, Searcher, s);
                    searchers[top++] = s;
                    break;
                default:
                    rb_raise(rb_eArgError, "Can't add class %s to MultiSearcher",
                             rb_obj_classname(rsearcher));
                    break;
            }
        }
        s = msea_new(searchers, top, false);
        Frt_Wrap_Struct(self, &frb_ms_mark, &frb_ms_free, s);
        object_add(s, self);
        return self;
    }

[Validate]

Generated with the Darkfish Rdoc Generator 2.