OpenSearch/rest-api-spec/test/mlt/30_ignore.yaml
Alex Ksikes 256712640f MLT Query: Support for ignore docs
Adds a `ignore_like` parameter to the MLT Query, which simply tells the
algorithm to skip all the terms from the given documents. This could be useful
in order to better guide nearest neighbor search by telling the algorithm to
never explore the space spanned by the given `ignore_like` docs. In essence we
are interested about the characteristic of a given item, but not of the ones
provided by `ignore_like`, thereby forcing the algorithm to go deeper in its
selection of terms. Note that this is different than simply performing a must
not boolean query on the unliked items. The syntax is exactly the same as the
`like` parameter.

Closes #8674
2014-11-28 14:48:43 +01:00

57 lines
1.1 KiB
YAML

---
"Basic mlt query with ignore like":
- do:
indices.create:
index: test_1
body:
settings:
number_of_replicas: 0
- do:
index:
index: test_1
type: test
id: 1
body: { foo: bar baz selected }
- do:
index:
index: test_1
type: test
id: 2
body: { foo: bar }
- do:
index:
index: test_1
type: test
id: 3
body: { foo: bar baz }
- do:
indices.refresh: {}
- do:
cluster.health:
wait_for_status: green
- do:
search:
index: test_1
type: test
body:
query:
more_like_this:
like:
_index: test_1
_type: test
_id: 1
ignore_like:
_index: test_1
_type: test
_id: 3
include: true
min_doc_freq: 0
min_term_freq: 0
- match: { hits.total: 1 }