Skip to content
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

Added the ability to include the queried document for More Like This API. #6067

Merged
merged 1 commit into from May 9, 2014

Conversation

alexksikes
Copy link
Contributor

By default More Like This API excludes the queried document from the response.
However, when debugging or when comparing scores across different queries, it
could be useful to have the best possible matched hit. So this option lets users
explicitly specify the desired behavior.

@@ -553,6 +569,8 @@ public void readFrom(StreamInput in) throws IOException {
minWordLength = in.readVInt();
maxWordLength = in.readVInt();
boostTerms = in.readFloat();
include = in.readBoolean();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks backward compatibility of the stream format, so you need to only read this boolean if the node that is sending this request to you has a recent enough version of Elasticsearch. It would look something like:

if (in.getVersion().onOrAfter(Version.V_1_2_0)) {
  include = in.readBoolean();
} else {
  include = false; // hard-coded behavior until Elasticsearch 1.2
}

@jpountz
Copy link
Contributor

jpountz commented May 7, 2014

This looks good, I just left one comment about stream versioning.

@jpountz
Copy link
Contributor

jpountz commented May 9, 2014

LGTM

…API.

By default More Like This API excludes the queried document from the response.
However, when debugging or when comparing scores across different queries, it
could be useful to have the best possible matched hit. So this option lets users
explicitly specify the desired behavior.

Closes elastic#6067
@alexksikes alexksikes merged commit dae48d9 into elastic:master May 9, 2014
alexksikes added a commit that referenced this pull request May 9, 2014
…API.

By default More Like This API excludes the queried document from the response.
However, when debugging or when comparing scores across different queries, it
could be useful to have the best possible matched hit. So this option lets users
explicitly specify the desired behavior.

Closes #6067
@jpountz jpountz removed the review label May 12, 2014
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :More Like This labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v1.2.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants