# Msearch: Failed to derive xcontent

**URL:** <https://discuss.elastic.co/t/msearch-failed-to-derive-xcontent/80854>\
**Category:** Elasticsearch\
**Created:** [March 31, 2017, 5:24pm UTC](https://discuss.elastic.co/t/msearch-failed-to-derive-xcontent/80854 "2017-03-31T17:24:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jattenberg](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jattenberg](https://discuss.elastic.co/u/jattenberg)\
**Post date:** [March 31, 2017, 5:24pm UTC](https://discuss.elastic.co/t/msearch-failed-to-derive-xcontent/80854/1 "2017-03-31T17:24:23Z")

</div>

I'm trying to get back a number of results (lines from chat data) simultaneously, however I'm stymied with what is wrong with my query. I get the error "Failed to derive xcontent [parse exception]", Query is `/myindex/_msearch` with the following data. using the javascript client. Cant grok what is wrong here. Any help?

```auto
[{},{"query":{"bool":{"filter":[{"type":{"value":"chat"}},{"term":{"channel.kw":"CHAT-bd3e5544-8ef9-473d-82d3-143ed6ef42c2"}},{"range":{"line_number":{"gte":0,"lte":6}}}]}},"sort":[{"line_number":{"order":"asc"}}]},{},{"query":{"bool":{"filter":[{"type":{"value":"chat"}},{"term":{"channel.kw":"CHAT-b90d7105-eb0e-4d92-b910-51f597b2a809"}},{"range":{"line_number":{"gte":0,"lte":6}}}]}},"sort":[{"line_number":{"order":"asc"}}]},{},{"query":{"bool":{"filter":[{"type":{"value":"chat"}},{"term":{"channel.kw":"CHAT-863b581a-5b7a-46ec-acf1-9aba03f18617"}},{"range":{"line_number":{"gte":0,"lte":6}}}]}},"sort":[{"line_number":{"order":"asc"}}]},{},{"query":{"bool":{"filter":[{"type":{"value":"chat"}},{"term":{"channel.kw":"CHAT-cf0cb9da-68df-45b7-af70-6656319e9b85"}},{"range":{"line_number":{"gte":0,"lte":6}}}]}},"sort":[{"line_number":{"order":"asc"}}]}]

```

---

<div class="post-metadata">

**Author:** ![jattenberg](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jattenberg](https://discuss.elastic.co/u/jattenberg)\
**Post date:** [April 2, 2017, 6:49pm UTC](https://discuss.elastic.co/t/msearch-failed-to-derive-xcontent/80854/2 "2017-04-02T18:49:13Z")

</div>

anyone?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 2, 2017, 7:08pm UTC](https://discuss.elastic.co/t/msearch-failed-to-derive-xcontent/80854/3 "2017-04-02T19:08:34Z")

</div>

That's not the expected format. Read [https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-multi-search.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-multi-search.html)

---

<div class="post-metadata">

**Author:** ![jattenberg](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jattenberg](https://discuss.elastic.co/u/jattenberg)\
**Post date:** [April 3, 2017, 3:27pm UTC](https://discuss.elastic.co/t/msearch-failed-to-derive-xcontent/80854/4 "2017-04-03T15:27:56Z")

</div>

I am referencing: [https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch)

According to this documentation, the JS msearch api accepts an array of objects, precisely what I'm passing in.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 3, 2017, 4:18pm UTC](https://discuss.elastic.co/t/msearch-failed-to-derive-xcontent/80854/5 "2017-04-03T16:18:24Z")

</div>

Can't see anything obvious as well.

I don't know the JS Client though and how it actually translates to a REST query. Could you debug it and paste here the query which is actually sent to elasticsearch?

May be it's a bug in the client?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 1, 2017, 4:18pm UTC](https://discuss.elastic.co/t/msearch-failed-to-derive-xcontent/80854/6 "2017-05-01T16:18:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
