Breaking change: pass options to searchParseDoc, instead of separate
arguments.
Showing
1 changed file
with
7 additions
and
2 deletions
... | @@ -243,11 +243,14 @@ define(function(require) { | ... | @@ -243,11 +243,14 @@ define(function(require) { |
243 | 243 | ||
244 | var self = this; | 244 | var self = this; |
245 | _.each(data.response.docs, function(doc, index) { | 245 | _.each(data.response.docs, function(doc, index) { |
246 | var docOptions = _.clone(options); | ||
246 | var itemHighlighting = highlighting[doc.id]; | 247 | var itemHighlighting = highlighting[doc.id]; |
247 | if (!itemHighlighting) { | 248 | if (!itemHighlighting) { |
248 | itemHighlighting = {}; | 249 | itemHighlighting = {}; |
249 | } | 250 | } |
250 | list.push(self.searchParseDoc(doc, index, itemHighlighting)); | 251 | docOptions.solrItemHighlighting = itemHighlighting; |
252 | docOptions.solrIndex = index; | ||
253 | list.push(self.searchParseDoc(doc, docOptions)); | ||
251 | }); | 254 | }); |
252 | 255 | ||
253 | return { | 256 | return { |
... | @@ -261,7 +264,9 @@ define(function(require) { | ... | @@ -261,7 +264,9 @@ define(function(require) { |
261 | hasResults: list.length > 0, | 264 | hasResults: list.length > 0, |
262 | }; | 265 | }; |
263 | }, | 266 | }, |
264 | searchParseDoc: function searchParseDoc(doc, index, itemHighlighting) { | 267 | searchParseDoc: function searchParseDoc(doc, options) { |
268 | var index = options.solrIndex; | ||
269 | var itemHighlighting = options.solrItemHighlighting; | ||
265 | var fieldsToParse = Util.mergeStaticProps(this.constructor, Solr, {}, 'parsedFieldMap'); | 270 | var fieldsToParse = Util.mergeStaticProps(this.constructor, Solr, {}, 'parsedFieldMap'); |
266 | var result = {}; | 271 | var result = {}; |
267 | _.each(fieldsToParse, function(value, key) { | 272 | _.each(fieldsToParse, function(value, key) { | ... | ... |
-
Please register or sign in to post a comment