IMPORTANT: elasticsearch.js has been replaced by the new Elasticsearch JavaScript client. We strongly advise you to migrate to the new client. To learn more, see the migration guide.
explain
editexplain
editclient.explain([params, [callback]])
Provides details about a specific document’s score in relation to a specific query. It will also tell you if the document matches the specified query.
Check the API Conventions and the elasticsearch docs for more information pertaining to this method.
See how a document is scored against a simple query.
const response = await client.explain({ // the document to test index: 'myindex', type: 'mytype', id: '1', // the query to score it against q: 'field:value' });
See how a document is scored against a query written in the Query DSL.
const response = await client.explain({ index: 'myindex', type: 'mytype', id: '1', body: { query: { match: { title: 'test' } } } });
Params
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|