   constructor: (@_terms, @_accountIds) ->
     super(null, {asResultSet: true})
 
-    @_version = 0
+    @_termsVersion = 0
     _.defer => @retrievePage(0)
 
   terms: =>

        json: true
        returnsModel: true
      .then (threads) =>
        return unless @_version is version

        resultIds = resultIds.concat _.pluck(threads, 'id')
        query = DatabaseStore.findAll(Thread).where(id: resultIds).order(Thread.attributes.lastMessageReceivedTimestamp.descending())
        @replaceQuery(query)

module.exports = SearchSubscription


  setTerms: (terms) =>
    @_terms = terms
    @_termsVersion += 1
    @retrievePage(0)

  replaceRange: (range) =>
