# More\_like\_this via Nest for document results in 500 error from ES 6.2.2

**URL:** <https://discuss.elastic.co/t/more-like-this-via-nest-for-document-results-in-500-error-from-es-6-2-2/122272>\
**Category:** Elasticsearch\
**Created:** [March 2, 2018, 2:32pm UTC](https://discuss.elastic.co/t/more-like-this-via-nest-for-document-results-in-500-error-from-es-6-2-2/122272 "2018-03-02T14:32:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![radleta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radleta/32/27653_2.png) [@radleta](https://discuss.elastic.co/u/radleta)\
**Post date:** [March 2, 2018, 2:32pm UTC](https://discuss.elastic.co/t/more-like-this-via-nest-for-document-results-in-500-error-from-es-6-2-2/122272/1 "2018-03-02T14:32:45Z")

</div>

We upgraded from ES 5.6 to ES 6.2.2 and started having an issue using .NET Nest 6.1.0 to call ES for more\_like\_this queries. This use to work against ES 5.6 but fails with ES 6.2.2.

The more\_like\_this are done via document and it appears the "\_id" field is serialized into the request as with null for value. This results in the below error.

Example call.

```auto
{
  "size": 250,
  "sort": [
    {
      "_score": {
        "order": "desc"
      }
    }
  ],
  "_source": {
    "includes": [
      "mypkid"
    ]
  },
  "query": {
    "function_score": {
      "query": {
        "bool": {
          "must": [
            {
              "more_like_this": {
                "fields": [
                  "mytitle",
                  "mybody",
                  "myalttext"
                ],
                "like": [
                  {
                    "_index": "myindex",
                    "_type": "mydoctype",
                    "_id": null,
                    "doc": {
                      "altfkid": 0,
                      "mytitle": "title goes here",
                      "fkid": 0,
                      "mybody": "document text goes here",
                      "myalttext": "alt text goes here"
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      "functions": [
        {
          "filter": {
            "multi_match": {
              "query": "look for these words",
              "fields": [
                "myalttext",
                "mytitle"
              ]
            }
          },
          "weight": 1
        }
      ]
    }
  }
}

```

Error result.

```auto
{
    "error": {
        "root_cause": [
            {
                "type": "illegal_state_exception",
                "reason": "Can't get text on a VALUE_NULL at 1:290"
            }
        ],
        "type": "illegal_state_exception",
        "reason": "Can't get text on a VALUE_NULL at 1:290"
    },
    "status": 500
}

```

---

<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:** [March 30, 2018, 2:33pm UTC](https://discuss.elastic.co/t/more-like-this-via-nest-for-document-results-in-500-error-from-es-6-2-2/122272/2 "2018-03-30T14:33:11Z")

</div>

Closed on March 30, 2018, 2:33pm UTC

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