def search (type, *queries)

      run_query = true
      run_query = queries.pop if queries.last == false

      raise(
        ArgumentError.new("pass at least one prepared query")
      ) if queries.size < 1

      t = META_TYPES[type]

      raise(
        ArgumentError.new("no search type #{type.inspect}")
      ) unless t

      q = queries.shift.original
      qs = queries.collect { |qq| qq.original }

      pks = q.metasearch(qs, META_TYPES[type])

      run_query ? lget(pks) : pks
    end
def search (type, *queries)

      run_query = true
      run_query = queries.pop if queries.last == false

      raise(
        ArgumentError.new("pass at least one prepared query")
      ) if queries.size < 1

      t = META_TYPES[type]

      raise(
        ArgumentError.new("no search type #{type.inspect}")
      ) unless t

      q = queries.shift.original
      qs = queries.collect { |qq| qq.original }

      pks = q.metasearch(qs, META_TYPES[type])

      run_query ? lget(pks) : pks
    end
A #search a la ruby-tokyotyrant
 (http://github.com/actsasflinn/ruby-tokyotyrant/tree)

   r = table.search(
     :intersection,
     @t.prepare_query { |q|
       q.add 'lang', :includes, 'es'
     },
     @t.prepare_query { |q|
       q.add 'lang', :includes, 'li'
     }
   )

 Accepts the symbols :union, :intersection, :difference or :diff as
 first parameter.

 If the last element element passed to this method is the value 'false',
 the return value will the array of matching primary keys.