Dagger
Search

elasticsearch

An Elasticsearch module designed for development and CI purposes only.

Installation

dagger install github.com/mgreau/daggerverse/elasticsearch@v0.2.0

Entrypoint

Return Type
Elasticsearch !
Arguments
NameTypeDescription
versionString !No description provided
modeString !No description provided
javaOptsString !No description provided
portInteger !No description provided
curlContainer The container to run curl to call the Elasticsearch APIs
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@bb854b701cc9319f87823411a0b156564b47e8b7 call \
 --version string --mode string --java-opts string --port integer
func (m *myModule) example(version string, mode string, javaOpts string, port int) *Elasticsearch  {
	return dag.
			Elasticsearch(version, mode, javaOpts, port)
}
@function
def example(version: str, mode: str, java_opts: str, port: int, ) -> dag.Elasticsearch:
	return (
		dag.elasticsearch(version, mode, java_opts, port)
	)
@func()
example(version: string, mode: string, javaOpts: string, port: number, ): Elasticsearch {
	return dag
		.elasticsearch(version, mode, javaOpts, port)
}

Types

Elasticsearch 🔗

service() 🔗

Create an Elasticsearch service in dev mode by default

Return Type
Service !
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@bb854b701cc9319f87823411a0b156564b47e8b7 call \
 --version string --mode string --java-opts string --port integer service
func (m *myModule) example(version string, mode string, javaOpts string, port int) *Service  {
	return dag.
			Elasticsearch(version, mode, javaOpts, port).
			Service()
}
@function
def example(version: str, mode: str, java_opts: str, port: int, ) -> dagger.Service:
	return (
		dag.elasticsearch(version, mode, java_opts, port)
		.service()
	)
@func()
example(version: string, mode: string, javaOpts: string, port: number, ): Service {
	return dag
		.elasticsearch(version, mode, javaOpts, port)
		.service()
}

get() 🔗

Sends a GET request to the ES service and returns the response.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
pathString !""No description provided
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@bb854b701cc9319f87823411a0b156564b47e8b7 call \
 --version string --mode string --java-opts string --port integer get --path string
func (m *myModule) example(ctx context.Context, version string, mode string, javaOpts string, port int, path string) string  {
	return dag.
			Elasticsearch(version, mode, javaOpts, port).
			Get(ctx, path)
}
@function
async def example(version: str, mode: str, java_opts: str, port: int, path: str) -> str:
	return await (
		dag.elasticsearch(version, mode, java_opts, port)
		.get(path)
	)
@func()
async example(version: string, mode: string, javaOpts: string, port: number, path: string): Promise<string> {
	return dag
		.elasticsearch(version, mode, javaOpts, port)
		.get(path)
}

delete() 🔗

Delete an Elasticsearch index.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
indexString !""No description provided
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@bb854b701cc9319f87823411a0b156564b47e8b7 call \
 --version string --mode string --java-opts string --port integer delete --index string
func (m *myModule) example(ctx context.Context, version string, mode string, javaOpts string, port int, index string) string  {
	return dag.
			Elasticsearch(version, mode, javaOpts, port).
			Delete(ctx, index)
}
@function
async def example(version: str, mode: str, java_opts: str, port: int, index: str) -> str:
	return await (
		dag.elasticsearch(version, mode, java_opts, port)
		.delete(index)
	)
@func()
async example(version: string, mode: string, javaOpts: string, port: number, index: string): Promise<string> {
	return dag
		.elasticsearch(version, mode, javaOpts, port)
		.delete(index)
}

indexData() 🔗

Index a document from a file into Elasticsearch.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
dataFile !-A file.
indexString !"my-index"No description provided
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@bb854b701cc9319f87823411a0b156564b47e8b7 call \
 --version string --mode string --java-opts string --port integer index-data --data file:path --index string
func (m *myModule) example(ctx context.Context, version string, mode string, javaOpts string, port int, data *File, index string) string  {
	return dag.
			Elasticsearch(version, mode, javaOpts, port).
			IndexData(ctx, data, index)
}
@function
async def example(version: str, mode: str, java_opts: str, port: int, data: dagger.File, index: str) -> str:
	return await (
		dag.elasticsearch(version, mode, java_opts, port)
		.index_data(data, index)
	)
@func()
async example(version: string, mode: string, javaOpts: string, port: number, data: File, index: string): Promise<string> {
	return dag
		.elasticsearch(version, mode, javaOpts, port)
		.indexData(data, index)
}

indexBulkData() 🔗

Index documents into Elasticsearch with the bulk API.

The data file should be in a format that is compatible with the Elasticsearch bulk API.

Doc: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html#docs-bulk

Return Type
String !
Arguments
NameTypeDefault ValueDescription
dataFile !-A file.
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@bb854b701cc9319f87823411a0b156564b47e8b7 call \
 --version string --mode string --java-opts string --port integer index-bulk-data --data file:path
func (m *myModule) example(ctx context.Context, version string, mode string, javaOpts string, port int, data *File) string  {
	return dag.
			Elasticsearch(version, mode, javaOpts, port).
			IndexBulkData(ctx, data)
}
@function
async def example(version: str, mode: str, java_opts: str, port: int, data: dagger.File) -> str:
	return await (
		dag.elasticsearch(version, mode, java_opts, port)
		.index_bulk_data(data)
	)
@func()
async example(version: string, mode: string, javaOpts: string, port: number, data: File): Promise<string> {
	return dag
		.elasticsearch(version, mode, javaOpts, port)
		.indexBulkData(data)
}

search() 🔗

Returns search hits that match the query defined in the request.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
indexString !""No description provided
fieldString !""No description provided
queryString !""No description provided
Example
dagger -m github.com/mgreau/daggerverse/elasticsearch@bb854b701cc9319f87823411a0b156564b47e8b7 call \
 --version string --mode string --java-opts string --port integer search --index string --field string --query string
func (m *myModule) example(ctx context.Context, version string, mode string, javaOpts string, port int, index string, field string, query string) string  {
	return dag.
			Elasticsearch(version, mode, javaOpts, port).
			Search(ctx, index, field, query)
}
@function
async def example(version: str, mode: str, java_opts: str, port: int, index: str, field: str, query: str) -> str:
	return await (
		dag.elasticsearch(version, mode, java_opts, port)
		.search(index, field, query)
	)
@func()
async example(version: string, mode: string, javaOpts: string, port: number, index: string, field: string, query: string): Promise<string> {
	return dag
		.elasticsearch(version, mode, javaOpts, port)
		.search(index, field, query)
}