pelias/api — pull request #35 by hkrishna (2014-10-15 22:11:02+00:00)
Title: [Do not merge] mget for real - first pass 

experiencing problems with the backend client.

ideally, the cmd thats sent to the elasticsearch client should look like this

```
[
{ index: 'pelias', type: 'geoname', id: '4193605' },
{ index: 'pelias', type: 'geoname', id: '4193595' }
]
```

but the backend errors out with the following error message:
```
{ [Error: ElasticsearchParseException[Failed to derive xcontent from org.elasticsearch.common.bytes.BytesArray@1]]
message: 'ElasticsearchParseException[Failed to derive xcontent from org.elasticsearch.common.bytes.BytesArray@1]' }
```

Then, I looked at https://github.com/geopipes/elasticsearch-backend/blob/master/index.js#L38 and changed my cmd to just be an array of ids
```
{
index: 'pelias',
type: 'geoname',
ids: [ '4193605', '4193595' ]
}
```
but it errored out with the following
```
{ [Error: ElasticsearchParseException[Failed to derive xcontent from org.elasticsearch.common.bytes.ChannelBufferBytesReference@efc39159]]
message: 'ElasticsearchParseException[Failed to derive xcontent from org.elasticsearch.common.bytes.ChannelBufferBytesReference@efc39159]' }
```

I might have to rewrite the mget endpoint in the elasticsearch-backend, right? Or am I missing something? I say rewrite because if sets one type for multiple ids but the reality is that we might have a batch request with different types (geoname/123, osmnode/1234 etc)

Thoughts?