diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6 index d0f4c6e5cb5..305d610b029 100644 --- a/app/assets/javascripts/discourse/controllers/composer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer.js.es6 @@ -223,6 +223,13 @@ export default Discourse.Controller.extend({ if (body.length < Discourse.SiteSettings.min_body_similar_length || title.length < Discourse.SiteSettings.min_title_similar_length) { return; } + // TODO pass the 200 in from somewhere + body = body.substr(0, 200); + + // Done search over and over + if((title + body) === this.get('lastSimilaritySearch')) { return; } + this.set('lastSimilaritySearch', title + body); + var messageController = this.get('controllers.composer-messages'), similarTopics = this.get('similarTopics');