def base_search(index, query, params, search, schema):
 with index.searcher() as searcher:
  queries = []
  for param in params:
   if search[param]:
    parser = qparser.QueryParser(param, schema)
    queries.append(parser.parse(query))
  terms = functools.reduce((lambda x, y: (x | y)), queries)
  return [result['pk'] for result in searcher.search(terms)]

def base_search ( index , query , params , search , schema ) : with index . searcher ( ) as searcher : queries = [ ] for param in params : if search [ param ] : parser = qparser . QueryParser ( param , schema ) queries . append ( parser . parse ( query ) ) terms = functools . reduce ( ( lambda x , y : ( x | y ) ) , queries ) return [ result [ 'pk' ] for result in searcher . search ( terms ) ]
wrapper for fulltext search .