You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -496,6 +496,11 @@ by combining inserts or using aggressive caching.
496
496
497
497
For full details see the [docs on bulk operations](docs/bulk.md).
498
498
499
+
500
+
501
+
502
+
503
+
499
504
## Show Query JSON
500
505
501
506
It can be useful to see the json output of requests in case you wish to tinker with the request in a REST client or your browser. It can be much easier to tweak a complicated query when you have the instant feedback of the HTTP interface.
@@ -513,6 +518,15 @@ Not all requests have a json body. For example _get-by-id_ is modelled purely by
513
518
514
519
515
520
521
+
522
+
## Aliases
523
+
524
+
An [index alias](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html) is a logical name used to reference one or more indices. Most Elasticsearch APIs accept an index alias in place of an index name.
525
+
526
+
For elastic4s syntax for aliases [click here](docs/alias.md).
527
+
528
+
529
+
516
530
## Synchronous Operations
517
531
518
532
All operations are normally asynchronous. Sometimes though you might want to block - for example when doing snapshots or when creating the initial index. You can call `.await` on any operation to block until the result is ready. This is especially useful when testing.
@@ -525,6 +539,9 @@ val resp = client.execute {
525
539
526
540
527
541
542
+
543
+
544
+
528
545
## Search Iterator
529
546
530
547
Sometimes you may wish to iterate over all the results in a search, without worrying too much about handling futures, and re-requesting
@@ -549,6 +566,10 @@ batch have been iterated on, the `SearchIterator` will then execute another quer
549
566
So if you are looking for a pure non blocking solution, consider the reactive streams implementation. However, if you just want a
550
567
quick and simple way to iterate over some data without bringing back all the results at once `SearchIterator` is perfect.
551
568
569
+
570
+
571
+
572
+
552
573
## Elastic Reactive Streams
553
574
554
575
Elastic4s has an implementation of the [reactive streams](http://www.reactive-streams.org) api for both publishing and subscribing that is built
An [index alias](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html) is a logical name used to reference one or more indices. Most Elasticsearch APIs accept an index alias in place of an index name.
4
+
5
+
### Add and Remove
6
+
7
+
To add and remove aliases using elastic4s, we create instances of `AliasAction` and pass those to an `AliasRequest` which we can create manually or by the DSL method `aliases`.
8
+
9
+
For example, to add a single alias to the `beach` index.
10
+
11
+
```scala
12
+
client.execute {
13
+
aliases(
14
+
addAlias("beaches_alias", "beach")
15
+
)
16
+
}
17
+
```
18
+
19
+
We can perform multiple alias actions in a single request, including removal.
20
+
21
+
```scala
22
+
client.execute {
23
+
aliases(
24
+
removeAlias("beaches_alias", "beach"),
25
+
addAlias("mountains_alias", "mountains")
26
+
)
27
+
}
28
+
```
29
+
30
+
### Filters
31
+
32
+
Aliases can also include [filters](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html#filtered).
0 commit comments