62 lines
1.2 KiB
Plaintext
62 lines
1.2 KiB
Plaintext
// This file is autogenerated, DO NOT EDIT
|
|
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
|
|
|
[source, js]
|
|
----
|
|
const response = await client.search({
|
|
query: {
|
|
match: {
|
|
comment: {
|
|
query: "foo bar",
|
|
},
|
|
},
|
|
},
|
|
rescore: {
|
|
window_size: 50,
|
|
query: {
|
|
rescore_query: {
|
|
match_phrase: {
|
|
comment: {
|
|
query: "foo bar",
|
|
slop: 1,
|
|
},
|
|
},
|
|
},
|
|
rescore_query_weight: 10,
|
|
},
|
|
},
|
|
_source: false,
|
|
highlight: {
|
|
order: "score",
|
|
fields: {
|
|
comment: {
|
|
fragment_size: 150,
|
|
number_of_fragments: 3,
|
|
highlight_query: {
|
|
bool: {
|
|
must: {
|
|
match: {
|
|
comment: {
|
|
query: "foo bar",
|
|
},
|
|
},
|
|
},
|
|
should: {
|
|
match_phrase: {
|
|
comment: {
|
|
query: "foo bar",
|
|
slop: 1,
|
|
boost: 10,
|
|
},
|
|
},
|
|
},
|
|
minimum_should_match: 0,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
----
|