ember-data-elasticsearch
ember-data-elasticsearch copied to clipboard
strange results in findQuery function
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