javanna / elasticshell Goto Github PK
View Code? Open in Web Editor NEWA javascript shell for elasticsearch
License: Apache License 2.0
A javascript shell for elasticsearch
License: Apache License 2.0
Add support for external editor
Only some of the methods exposed by the different clients are currently documented.
Therefore when typing the name of the method without brackets some code is shown.
This issue is about adding the help for the indices api.
The shell supports multiple lines commands. The suggestions only work on the first line though. The problem is that when we are on the second line we don't take into account the first line too.
Seems to be a JLine limitations, which don't support multiline very well.
Would be nice to be able to load at startup an external script that can contain any command that's valid within the shell: json object, java or javascript code for instance.
For example: it might contain common queries that are often used.
Hi,
bin/elasticshell.bat
gives me:
Error: Unable to access jarfile lib/${project.build.finalName}.jar
Only some of the methods exposed by the different clients are currently documented.
Therefore when typing the name of the method without brackets some code is shown.
This issue is about adding the help for the cluster api.
Creating a node client there's quite a bug:
line 1: Wrapped java.lang.NullPointerException: null value in entry: name=null
There's a problem when reading the name of the node from the settings.
JLine has a nice FileNameCompleter which should make it easy to autocomplete path and file names, useful since we can load external files, or save to external files.
On the other hand some custom code is required to make the existing completer work together with the one for file names and paths.
Save history to file at shutdown and load it at startup
Like #15 , this time in explain api
Currently mapping, settings etc. are simply json documents.
We should consider to add some builders for them, to make it easier to deal with their json.
The following put template request
es.indicesApi().templatePut('0_replicas',{"template" : "te*","settings":{"number_of_replicas":0}});
gives the following error, despite the name '0_replicas' is in the request:
line 1: Wrapped org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: name is missing;
The default type is shown among the indices auto-suggestions.
It should be filtered out.
Add command that allows to load an external javascript file, which may contain either json variables, like queries or documents, or an useful library, like elastic.js.
add a command that allows to convert ToXContent objects to json, native within the shell.
This way the json produced through all the different builders (FacetBuilders etc.) can easily be converted to native json and be combined with existing json objects.
Only some of the methods exposed by the different clients are currently documented.
Therefore when typing the name of the method without brackets some code is shown.
This issue is about adding the help for request builders.
The Maven POM sets the compiler plugin source to 1.6, but then targets the binary for Java 7, which then prevents this from running on Java 6 (sadly what I have to deal with).
Any reason the compiler target couldn't be set to 6? It'll still run on 7.
The history stores every single line as a different command. After typing a multiline command, or a json object for example, every line is a different entry in the history. Would be nice to be able to run that same command in a single call; that would be possible if all lines were merged to the same entry within the history.
Seems to be a JLine limitation; there are possible work arounds and examples in other projects, here is one: https://github.com/apache/karaf/blob/karaf-2.3.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java#L227
All the commands should be mentioned in the generic help message, obtained using the help command.
Some of them are currently missing, add them and make sure this won't happen again.
Add couple of methods to the clients that allow to either save to file a dump of an index and restore it
Add history command that allows to see all the previously executed commands. Use the line number as a prefix for each command.
Given how help messages are looked up, via reflection. It's possible to provide help for classes that are not part of the elasticshell directly.
Would be nice to add help for elaticsearch builders that are supposed to be used within the shell: FacetBuilders etc.
Add configurable playground mode that allows to automatically start up a local node and create a client connected to it.
Make possible to customize the shell prompt
Would be great to be able to easily install this via brew. Will work on this as soon as I find some time.
PS: Love this tool!
Add a command that allows to save to file any string. It can be json or any string representation obtained unwrapping objects from the shell and calling their toString.
The main usecase is to save to file big json objects that don't fit in a single screen and are not handy to copy paste.
It would be nice to customize the way the auto suggestions are shown, for instance grouping them.
Indexes would then be in their own group, separated from methods and functions.
Unfortunately it looks like this is not easy to achieve due to the JLine api.
A validation error is thrown when trying to add a template using the builder.
It should be possible to provide a simple string to the search api. That would be put in a query string and sent straight away.
Add support for keyboard shortcuts
Would be nice to have some kind of syntax highlighting, from a simple bracket matching to something more advanced with different colors etc.
Like #15 , this time in validate api
Add a command that allows to send http requests.
Useful to communicate with other systems, or even with elasticsearch itself when not possible to use the Java API (different version).
Would be nice to have a command per request method.
Would be nice to have a command that fires up a new (jvm) local node so that it's possible to try around elasticsearch within the shell, without needing to install it.
Like #15 , this time in count api
Make possible to try out the shell without actually downloading it.
Embed it in the browser would be great but probably hard to achieve.
On the other hand java web start would be an option too, even though it should download the zip file which is not that small.
Only some of the methods exposed by the different clients are currently documented.
Therefore when typing the name of the method without brackets some code is shown.
This issue is about adding the help for the core api.
Like #15 this time in delete by query api
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.