How to use "explain" in Elasticsearch-PHP search operation?

Hi!

I'm using ELK via Elasticsearch-PHP. I want to use "explain" in certain circumstances. When I write "explain" or "_explain" before or within "body" the result contains explanation in some cases, but it always returns with exceptions like this:

Elasticsearch\Common\Exceptions\UnexpectedValueException - explain is not a valid parameter. Allowed parameters are allow_no_indices, analyze_wildcard, analyzer, default_operator, df, error_trace, expand_wildcards, filter_path, human, ignore_throttled, ignore_unavailable, lenient, min_score, opaqueId, preference, pretty, q, routing, source, terminate_after

Elasticsearch\Common\Exceptions\UnexpectedValueException - _explain is not a valid parameter. Allowed parameters are _source, _source_excludes, _source_includes, allow_no_indices, allow_partial_search_results, analyze_wildcard, analyzer, batched_reduce_size, ccs_minimize_roundtrips, default_operator, df, docvalue_fields, error_trace, expand_wildcards, explain, filter_path, from, human, ignore_throttled, ignore_unavailable, lenient, max_concurrent_shard_requests, opaqueId, pre_filter_shard_size, preference, pretty, q, request_cache, rest_total_hits_as_int, routing, scroll, search_type, seq_no_primary_term, size, sort, source, stats, stored_fields, suggest_field, suggest_mode, suggest_size, suggest_text, terminate_after, timeout, track_scores, track_total_hits, typed_keys, version

Elasticsearch\Common\Exceptions\BadRequest400Exception - {"error":{"root_cause":[{"type":"parsing_exception","reason":"request does not support [explain]","line":1,"col":2}],"type":"parsing_exception","reason":"request does not support [explain]","line":1,"col":2},"status":400}

Elasticsearch\Common\Exceptions\BadRequest400Exception - {"error":{"root_cause":[{"type":"parsing_exception","reason":"Unknown key for a VALUE_BOOLEAN in [_explain].","line":1,"col":32}],"type":"parsing_exception","reason":"Unknown key for a VALUE_BOOLEAN in [_explain].","line":1,"col":32},"status":400}

Is it possible and how to get what I want?

Thanks in advance.

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