Using more like this query with documents containing nested objects

We have two types A and B. In type A there are some nested properties, which has some text similar to the text in documents of type B.

When we do the following query, the returned results are empty, even though there are matching documents in type B.

  1. POST test/B/_search
    {
    "query": {
    "more_like_this": {
    "like": [{
    "_index": "test",
    "_type": "A",
    "_id": "4",
    }],
    "min_term_freq": 1,
    "min_doc_freq": 1
    }
    }
    }

But if we just copy and paste the from the properties of nested objects in the query as below, it works as expected.
2. POST test/B/_search
{
"query": {
"more_like_this": {
"like": ["some text from nested object fields"],
"min_term_freq": 1,
"min_doc_freq": 1
}
}
}

what is wrong with our first query?
Elasticsearch version: 5.5.1

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