ember-data-elasticsearch icon indicating copy to clipboard operation
ember-data-elasticsearch copied to clipboard

strange results in findQuery function

Open opennomad opened this issue 12 years ago • 0 comments

I was having issues with returning results via findQuery. The returned array contained the right number of results, but they all only showed the first result repeated.

I modified the code to use the same approach as findAll function and that produced the desired results.

Here is a patch to elasticsearch_adapter.js

186c186,188
<       recordArray.load(data['hits']['hits'].map( function(i) { return i['_source'] } ));

---
>       recordArray.load(data['hits']['hits'].map( function(i) {
>         return Ember.Object.create(i['_source']).reopen({id: i._id, version: i._version})
>       } ));

@matthias

opennomad avatar May 06 '13 03:05 opennomad