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

Support for artificial documents in MLT query #7725

Closed
wants to merge 4 commits into from

Conversation

alexksikes
Copy link
Contributor

Previously, the only way to specify a document not present in the index was to
use like_text. This would usually lead to complex queries made of multiple
MLT queries per document field. This commit adds the ability to the MLT query
to directly specify documents not present in the index (artificial documents).
The syntax is similar to the Percolator API or to the Multi Term Vector API.

@@ -95,11 +95,11 @@ public static Uid createUid(String uid) {
return new Uid(uid.substring(0, delimiterIndex), uid.substring(delimiterIndex + 1));
}

public static BytesRef[] createUids(List<MultiGetRequest.Item> items) {
BytesRef[] uids = new BytesRef[items.size()];
public static BytesRef[] createUids(List<TermVectorRequest> requests) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we have a new interface called DocumentRequest that is more generic and I just checked that TermVectorRequest implements all the methods already. I think we should do that and make this List<DocumentRequest>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perfect! Thanks.

@s1monw
Copy link
Contributor

s1monw commented Sep 24, 2014

I left some minor comments looks good in general

Previously, the only way to specify a document not present in the index was to
use `like_text`. This would usually lead to complex queries made of multiple
MLT queries per document field. This commit adds the ability to the MLT query
to directly specify documents not present in the index (artificial documents).
The syntax is similar to the Percolator API or to the Multi Term Vector API.
@s1monw
Copy link
Contributor

s1monw commented Sep 29, 2014

LGTM thanks alex!!!

alexksikes added a commit that referenced this pull request Sep 29, 2014
Previously, the only way to specify a document not present in the index was to
use `like_text`. This would usually lead to complex queries made of multiple
MLT queries per document field. This commit adds the ability to the MLT query
to directly specify documents not present in the index (artificial documents).
The syntax is similar to the Percolator API or to the Multi Term Vector API.

Closes #7725
@alexksikes alexksikes deleted the feature/mlt-docs branch September 29, 2014 14:03
@im-denisenko im-denisenko mentioned this pull request Apr 6, 2015
16 tasks
@clintongormley clintongormley changed the title MLT Query: Support for artificial documents Support for artificial documents in MLT query Jun 6, 2015
@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
>feature :Search/Search Search-related issues that do not fall into other categories v1.5.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants