-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add support for distributed frequencies #8144
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
Conversation
Adds distributed frequencies support for the Term Vectors API. A new parameter called `dfs` is introduced which defaults to `false`.
|
||
@Override | ||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the two aboce methods, can you rather throw an UnsupportedOperationException if it is not supported and document that this dfs-only request/response objects are for internal use only?
try { | ||
sSource = XContentHelper.convertToJson(searchRequest.source(), false); | ||
} catch (Exception e) { | ||
// ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when can you get an exception here?
This looks good to me overall, however I have no experience at all with the transport layer so it would be good if someone else could review this PR before we get it in |
} | ||
} | ||
// wrap a search request object | ||
this.searchRequest = client.prepareSearch(indices).setTypes(types).setQuery(boolBuilder).request(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the whole client isn't necessary, you can just do this instead:
this.searchRequest = new SearchRequest(indices).types(types).source(new SearchSourceBuilder().query(boolBuilder));
Then you can also remove the client field in ShardTermVectorService.java.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx that's much nicer indeed.
@alexksikes This looks good. I left a couple of comments. |
@alexksikes this look great! LGTM |
Adds distributed frequencies support for the Term Vectors API. A new parameter called `dfs` is introduced which defaults to `false`. Closes #8144
Adds distributed frequencies support for the Term Vectors API. A new parameter
called
dfs
is introduced which defaults tofalse
.