 
   setTerms: (terms) =>
     @_terms = terms
-    @_version += 1
+    @_termsVersion += 1
     @retrievePage(0)
 
   replaceRange: (range) =>

        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

  constructor: (@_terms, @_accountIds) ->
    super(null, {asResultSet: true})

    @_termsVersion = 0
    _.defer => @retrievePage(0)

  terms: =>
