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

Query Changes #1

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

worleydl
Copy link
Collaborator

@worleydl worleydl commented Dec 7, 2018

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.

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");
Copy link
Owner

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.

Copy link
Owner

@mattflax mattflax left a 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());

Copy link
Owner

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);
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants