code: function generateSearchFilter(type, map, not) {
    var filter = {},
      filterType = filter[type] = {};
  
    Object.keys(map).forEach(function (key) {
      filterType[key] = map[key];
    });
  
    if (not) {
      return {
        not: filter
      };
    }
    return filter;
  }
docs: /*
  This module contains generic helper functions for generating filters
   /*
  generateSearchFilter
  
  This is a helper generator for filters.
  `type` is the type of filter to generate i.e. "term", "query", "prefix"
  `map` is an object whose keys are copied onto the generated filter.
  `not` is a boolean, if set to true, the filter is wrapped in a negation (not) filter