{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "failed to parse More Like This item. unknown field [_source]"
}
],
"type": "parse_exception",
"reason": "failed to parse More Like This item. unknown field [_source]"
},
"status": 400
}
Quick workaround would be using plain arrays as this:
Hi,
First of all there is a wrong signature of a function:
https://github.com/ruflin/Elastica/blob/master/lib/Elastica/Query/MoreLikeThis.php#L33
$like
obviously cannot be instance ofMoreLikeThis
it should bestring|Document|Document[]
Secondary, according to https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html list of documents inside
like
are perfectly supported. SadlytoArray()
renders a little bit wrong structure when arrays are used, so query fails due to existence of_source
field in request.Sample failing request:
Response:
Quick workaround would be using plain arrays as this:
so it kinda can be market as Wont Fix (and just update method signature to something like:
string|array|Document