     if options.query?
       options.data['$q'] = options.query
       @_setSearchString(options.query)
+      delete options.query
 
     # was there a search query in the past, and should we use it?
     else if @searchString?

module.exports = class Inspections extends Collection

  model: Inspection
  url: ->
    "http://data.cityofchicago.org/resource/4ijn-s7e5.json?$limit=#{@limit}&$select=#{DEFAULT_COLUMNS.join(',')}"

  limit: DEFAULT_LIMIT
  responseLength: 0

  searchType: null

    @_fetchSearch(options)
    @searchType = 'zip'

  _fetchSearch: (options={})->
    # is this fetch looking for more results of an existing search?
    if @responseLength >= @limit
      options.data = options.data || {}
      options.data['$offset'] = @responseLength
      options.remove = false

    options.data = _.extend @getDefaultData(), options.data
    @fetch(options)

  _setSearchString: (searchString)->
    @searchString = decodeURI searchString
