[search-index] Don't removeQuotedHTML when indexing threads

Summary:
This is a very expensive operation and there seemed to be few downsides
to including quoted portions in the index. We can revisit this to
improve how we index when we have a proper scheduler.

Test Plan: Run locally

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3682
This commit is contained in:
Mark Hahnenberg 2017-01-14 16:47:56 -08:00
parent 357cc854de
commit d60226f0c6

View file

@ -205,11 +205,7 @@ class ThreadSearchIndexStore {
thread.messages()
.then((messages) => (
messages
.map(({body, snippet}) => (
!_.isString(body) ?
{snippet} :
{body: QuotedHTMLTransformer.removeQuotedHTML(body)}
))
.map(({body, snippet}) => (!_.isString(body) ? {snippet} : {body}))
.map(({body, snippet}) => (
snippet || Utils.extractTextFromHtml(body, {maxLength: MESSAGE_BODY_LENGTH}).replace(/(\s)+/g, ' ')
))