Skip to content

tglowka/elasticsearcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This is a repository of a CLI tool called ElasticSearcher. The main purpose of the tool is to quick-querying the Elasticsearch in order to check whether a document of a given id exists, show the document content, list all the indices for a given pattern (e.g. tmp*), list corresponding aliases etc. For now the tool is very limited and provides just a few commands to play with. However, I plan to add more and more commands to the tool over time and I would be greatful for any contribution.

Important: The tool works with Elasticsearch version 8.

Installation

The tool can be installed from the NuGet - https://www.nuget.org/packages/BaldSolutions.ElasticSearcher

Usage

Once the tool is installed you can use the ess command to start querying the Elasticsearch. To check available commands, arguments and options the --help, -h or -? options show the tool description. Try to run:

ess --help

and you should see: image Each subsequent command (e.g. ping or doc) also accepts --help option for further explanation:

ess doc --help

image

Interactive Mode

The tool has an option called interactive (kind of a REPL). The interactive mode has the same functionalities as the ones mentioned in the Examples (no ess needed) sectiond and it has autocompletion feature. The only difference is that it does not apply the --uri option when in the interactive mode. To change the URI you must use the set-connection command.

Autocompletion

For now the autocompletion feature works when the Tab key is pressed. It suggests the command name and the operation (if applicable, e.g. the ping command has only the command part - ping and no operation part whereas the doc command has command part - doc and operation part - exists|search). Moreover, for the doc command has the autocompletion for the index name - type doc exists and press tab and you shold get index name as completion.

Examples

List indices

ess indices get tm*

image

ess indices get *

image

List aliases

ess indices get-aliases tm*

image

Search for a document

ess doc search tmp 581fbogByNfQfwWmNPFh

image

Combine the tool with VisualStudio Code

ess doc search tmp 581fbogByNfQfwWmNPFh | code -

This command opens the VisualStudio Code with the output of the ess command.

Contribution

I would be grateful for showing me any suggestion/idea/bug or other limitation/flaw. If there is anything you want to add regarding the tool please create an Issue or create a PR.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages