# Usage documentation for \_msearch

**URL:** <https://community.siren.io/t/usage-documentation-for-msearch/544>\
**Category:** Siren Federate (Elasticsearch Plugin)\
**Created:** [September 23, 2022, 10:13am UTC](https://community.siren.io/t/usage-documentation-for-msearch/544 "2022-09-23T10:13:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anand\_tripathi](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.siren.io/anand_tripathi/32/267_2.png) [@anand\_tripathi](https://community.siren.io/u/anand_tripathi)\
**Post date:** [September 23, 2022, 10:13am UTC](https://community.siren.io/t/usage-documentation-for-msearch/544/1 "2022-09-23T10:13:28Z")

</div>

I want to run some join queries on an index using /\_msearch APIs for multiple queries. There is the documentation for \_msearch API but it doesn’t have usage example for it. I am using the syntax of \_msearch of elasticsearch but that is also not working. I am using the below syntax

```auto
POST siren/<index_1>/_msearch
{}
{<join query>}
{"index": <index_1>}
{<join query>}

```

---

<div class="post-metadata">

**Author:** ![Stephane\_Campinas](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.siren.io/stephane_campinas/32/22_2.png) [@Stephane\_Campinas](https://community.siren.io/u/Stephane_Campinas)\
**Post date:** [September 23, 2022, 11:16am UTC](https://community.siren.io/t/usage-documentation-for-msearch/544/2 "2022-09-23T11:16:50Z")

</div>

What error do you get ?

---

<div class="post-metadata">

**Author:** ![anand\_tripathi](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.siren.io/anand_tripathi/32/267_2.png) [@anand\_tripathi](https://community.siren.io/u/anand_tripathi)\
**Post date:** [September 23, 2022, 11:29am UTC](https://community.siren.io/t/usage-documentation-for-msearch/544/3 "2022-09-23T11:29:43Z")

</div>

Related to xml parsing like below

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "x_content_e_o_f_exception",
        "reason" : "com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Object (start marker at [Source: (org.elasticsearch.common.io.stream.ByteBufferStreamInput); line: 1, column: 1])\n at [Source: (org.elasticsearch.common.io.stream.ByteBufferStreamInput); line: 1, column: 2]"
      }
    ],
    "type" : "x_content_e_o_f_exception",
    "reason" : "com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Object (start marker at [Source: (org.elasticsearch.common.io.stream.ByteBufferStreamInput); line: 1, column: 1])\n at [Source: (org.elasticsearch.common.io.stream.ByteBufferStreamInput); line: 1, column: 2]",
    "caused_by" : {
      "type" : "json_e_o_f_exception",
      "reason" : "Unexpected end-of-input: expected close marker for Object (start marker at [Source: (org.elasticsearch.common.io.stream.ByteBufferStreamInput); line: 1, column: 1])\n at [Source: (org.elasticsearch.common.io.stream.ByteBufferStreamInput); line: 1, column: 2]"
    }
  },
  "status" : 500
}

```

---

<div class="post-metadata">

**Author:** ![Stephane\_Campinas](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.siren.io/stephane_campinas/32/22_2.png) [@Stephane\_Campinas](https://community.siren.io/u/Stephane_Campinas)\
**Post date:** [September 23, 2022, 12:42pm UTC](https://community.siren.io/t/usage-documentation-for-msearch/544/4 "2022-09-23T12:42:15Z")

</div>

It seems your request is invalid. Make sure it is a proper NDJSON. Can you share the original request ?
