-
Notifications
You must be signed in to change notification settings - Fork 1
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
Query Changes #1
base: dev
Are you sure you want to change the base?
Conversation
…alidates plugin DSL syntax)
final Map<String, Object> configuration = Collections.emptyMap(); | ||
final Map<String, Object> configuration = new HashMap<>(); | ||
// Most of these don't actually apply except for plugins, but the class ExternalElastic extends expects them | ||
configuration.put("path.home", "/tmp"); |
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.
Could the value for path.home be changed to System.getProperty("java.io.tmpdir")
, for consistency across OSes. I appreciate it probably doesn't cause a directory to be created, but if we do decide to start the ES node in future, it may do so.
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'm mostly happy with this, I'd just like to avoid creating directories where we don't have to. It's a shame we need an RRENode for the plugins, but if there's no way around that then it can't be helped.
@@ -97,6 +108,7 @@ public void beforeStart(final Map<String, Object> configuration) { | |||
.put("path.logs", logsFolder.getAbsolutePath()) | |||
.put("path.data", dataFolder.getAbsolutePath()) | |||
.put("cluster.name", "rre_" + System.currentTimeMillis()); | |||
|
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'd be inclined to move the RRENode instantiation/settings build into its own method, so you don't need to do the whole beforeStart() method when you call from ExternalElasticsearch - eg. buildRreNode(configuration)
or simiilar. That will avoid redundant folders being created.
@@ -37,7 +38,8 @@ | |||
|
|||
@Override | |||
public void beforeStart(Map<String, Object> configuration) { | |||
// No-op for this implementation | |||
// Need RRE node instantiated to get plugin info (This does not start the node) | |||
super.beforeStart(configuration); |
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.
As mentioned above, if we can avoid calling the full beforeStart
method, I think we should.
This uses XContentParser to parse queries which adds compatibility for things like rescore and verifying the internals of an LTR query.
It does add some headache if you just want to get things working using an external instance, it requires that the plugins be installed local to RRE and configured in the pom file. I'm still weighing whether or not this is a good change for external, it makes sense for the internal engine.
Any thoughts? The alternative was to add another block that just parsed out a rescore object but I felt like there may be other plugins I have no idea about utilizing other keys.