-
Notifications
You must be signed in to change notification settings - Fork 24.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add versatile 'like' parameter #8039
Conversation
I like this thsi looks much better! Can we maybe have some comments next to the parse fields which of them are deprecated? |
LGTM - I wonder if we should wait with this a bit and refactor ParseField LIKE_TEXT = new ParseField("like_text", true /* deprecated */, "like" /* the actual field to use instead */); such that we can barf with the strict parse option? (note my example might not be the best way to implement it) |
OK I've just opened #8067 |
The MLT query has a lot of parameters. For example, a set of documents is specified with either `like_text`, `ids` or `docs`, with at least one parameter required. This commit groups all the document specification parameters under one called `like`. The syntax is described below and could easily be extended to allow for new means of specifying document input. The `like_text`, `ids` and `docs` parameters are deprecated. As a single piece text: { "query": { "more_like_this": { "like": "some text here" } } } As a single item: { "query": { "more_like_this": { "like": { "_index": "imdb", "_type": "movies", "_id": "88247" } } } } Or as a mixture of all: { "query": { "more_like_this": { "like": [ "Some random text ...", { "_index": "imdb", "_type": "movies", "_id": "88247" }, { "_index": "imdb", "_type": "movies", "doc": { "title": "Document with an artificial title!" } } ] } } }
008ab7e
to
e9dfc0e
Compare
The MLT query has a lot of parameters. For example, a set of documents is
specified with either
like_text
,ids
ordocs
, with at least oneparameter required. This commit groups all the document specification
parameters under one called
like
. The syntax is described below and couldeasily be extended to allow for new means of specifying document input. The
like_text
,ids
anddocs
parameters are deprecated.As a single piece text:
As a single item:
Or as a mixture of all: