func (q *RegexpQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, explain bool) (search.Searcher, error) { field := q.Field if q.Field == "" { field = m.DefaultSearchField() } err := q.compile() if err != nil { return nil, err } return searcher.NewRegexpSearcher(i, q.compiled, field, q.Boost.Value(), explain) }
func (q *WildcardQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, explain bool) (search.Searcher, error) { field := q.Field if q.Field == "" { field = m.DefaultSearchField() } if q.compiled == nil { var err error q.compiled, err = q.convertToRegexp() if err != nil { return nil, err } } return searcher.NewRegexpSearcher(i, q.compiled, field, q.Boost.Value(), explain) }