Skip to content

Commit 00f43c7

Browse files
committed
Add ES|QL doc structure
1 parent 6547c74 commit 00f43c7

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

docs/index.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
88
:net-client: Elasticsearch .NET Client
99
:latest-version: 8.1.0
1010

11+
:es-docs: https://www.elastic.co/guide/en/elasticsearch/reference/{branch}
12+
1113
include::intro.asciidoc[]
1214

1315
include::getting-started.asciidoc[]

docs/usage/esql.asciidoc

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
[[esql]]
2+
== ES|QL in the .NET client
3+
4+
This page helps you understand and use {ref}/esql.html[ES|QL] in the
5+
.NET client.
6+
7+
There are two ways to use ES|QL in the .NET client:
8+
9+
* Use the Elasticsearch {es-docs}/esql-apis.html[ES|QL API] directly: This
10+
is the most flexible approach, but it's also the most complex because you must handle
11+
results in their raw form. You can choose the precise format of results,
12+
such as JSON, CSV, or text.
13+
* Use ES|QL mapping helpers: These mappers take care of parsing the raw
14+
response into something readily usable by the application. Several mappers are
15+
available for different use cases, such as object mapping, cursor
16+
traversal of results, and dataframes. You can also define your own mapper for specific
17+
use cases.
18+
19+
20+
21+
[discrete]
22+
[[esql-how-to]]
23+
==== How to use the ES|QL API
24+
25+
The {es-docs}/esql-query-api.html[ES|QL query API] allows you to specify how
26+
results should be returned. You can choose a
27+
{es-docs}/esql-rest.html#esql-rest-format[response format] such as CSV, text, or
28+
JSON, then fine-tune it with parameters like column separators
29+
and locale.
30+
31+
// Add any .NET-specific usage notes
32+
33+
The following example gets ES|QL results as CSV and parses them:
34+
35+
// Code example to be written
36+
37+
38+
[discrete]
39+
[[esql-consume-results]]
40+
==== Consume ES|QL results
41+
42+
The previous example showed that although the raw ES|QL API offers maximum
43+
flexibility, additional work is required in order to make use of the
44+
result data.
45+
46+
To simplify things, try working with these three main representations of ES|QL
47+
results (each with its own mapping helper):
48+
49+
* **Objects**, where each row in the results is mapped to an object from your
50+
application domain. This is similar to what ORMs (object relational mappers)
51+
commonly do.
52+
* **Cursors**, where you scan the results row by row and access the data using
53+
column names. This is similar to database access libraries.
54+
* **Dataframes**, where results are organized in a column-oriented structure that
55+
allows efficient processing of column data.
56+
57+
// Code examples to be written for each of them, depending on availability in the language
58+
59+
60+
[discrete]
61+
[[esql-custom-mapping]]
62+
==== Define your own mapping
63+
64+
Although the mappers provided by the .NET client cover many use cases, your
65+
application might require a custom mapping.
66+
You can write your own mapper and use it in a similar way as the
67+
built-in ones.
68+
69+
Note that mappers are meant to provide a more usable representation of ES|QL
70+
results—not to process the result data. Data processing should be based on
71+
the output of a result mapper.
72+
73+
Here's an example mapper that returns a simple column-oriented
74+
representation of the data:
75+
76+
// Code example to be written

docs/usage/index.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ For a full reference, see the {ref}/[Elasticsearch documentation] and in particu
99
If you're new to {es}, make sure also to read {ref}/getting-started.html[Elasticsearch's quick start] that provides a good introduction.
1010

1111
* <<recommendations, Usage recommendations>>
12+
* <<esql>>
1213
* <<examples, CRUD usage examples>>
1314

15+
1416
NOTE: This is still a work in progress, more sections will be added in the near future.
1517

1618
include::recommendations.asciidoc[]
19+
include::esql.asciidoc[]
1720
include::examples.asciidoc[]

0 commit comments

Comments
 (0)