Skip to content

Commit 01a6119

Browse files
committed
Add subsections for both elasticsearch accesses
1 parent 41432b4 commit 01a6119

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

example.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ Hello, world
9090
```
9191

9292
## Check that `doc_1` is indexed in `full-text` indexer
93+
94+
### 1. Via `http://localhost:8080/index`
9395
The TextRepo stack has a perimeter `nginx` proxy which passes `/index` to the ElasticSearch indexes. So to pull everything from the `full-text` index, we can:
9496

9597
```bash
@@ -101,6 +103,22 @@ curl -s http://localhost:8080/index/full-text/_search \
101103

102104
Notice how we directly visit `http://localhost:8080` and don't use our shortcut ENV var `$tr` here, as `$tr` points to `http://localhost:8080/textrepo` and is thus proxied to `textrepo` instead of `elasticsearch` which we need here.
103105

106+
```json
107+
[
108+
{
109+
"_index": "full-text",
110+
"_type": "_doc",
111+
"_id": "a46dd361-bdf3-4cf6-a050-7434524a75b2",
112+
"_score": 1,
113+
"_source": {
114+
"contents": "Hello, world"
115+
}
116+
}
117+
]
118+
```
119+
Note that `_id` is equal to the `fileId` we saw [earlier](#import-a-document)
120+
121+
### 2. From inside the `elasticsearch` container
104122
Alternatively, and assuming `elasticsearch:9200` is not exposed via `docker-compose.yml`, we may want to run a query inside the `elasticsearch` container and pull out everything from the `full-text` index:
105123

106124
```bash
@@ -124,7 +142,6 @@ docker-compose -f docker-compose-dev.yml exec elasticsearch \
124142
}
125143
]
126144
```
127-
Note that `_id` is equal to the `fileId` we saw [earlier](#import-a-document)
128145

129146
If, instead, you get a host of errors like:
130147
```sh

0 commit comments

Comments
 (0)