Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions docs/dev-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

There is a [docker-compose file](../docker-compose.yml) in the root directory that allows for serving multiple development sites locally.

These are currently not using the real api but rather gets their settings from the static json files included in the data folder.
These are currently not using the real API but instead get their settings from the static JSON files included in the data folder.

The fake api is served by the [server.php](test/server.php) script and reads the corresponding [subdomain](data/WikiInfo-site1.json) from each request.
The fake API is served by the [server.php](test/server.php) script and reads the corresponding [subdomain](data/WikiInfo-site1.json) from each request.

ElasticSearch in docker compose environment uses non-shared index setup. Howerver the page should be refreshed a few time before ES content indexes got updated due to the lack of a dedicated job runner.

ElasticSearch index names are based on the wiki database name (not the domain). This is why indices appear in the format `{db_name}_content_first` and `{db_name}_general_first`, for example `mwdb_somedb1_content_first`.

### Start the dev environment

Expand All @@ -29,8 +33,12 @@ Wait until both sites are accessible:
Once the sites are accessible you can perform secondary setup (_The request takes a while to execute_):

```sh
curl -l -X POST "http://site1.localhost:8001/w/api.php?action=wbstackElasticSearchInit&format=json"
curl -l -X POST "http://site2.localhost:8001/w/api.php?action=wbstackElasticSearchInit&format=json"
curl -sS -H "Content-Type: application/json" -X POST -d '{}' "http://site1.localhost:8001/w/api.php?action=wbstackElasticSearchInit&format=json"
curl -sS -H "Content-Type: application/json" -X POST -d '{}' "http://site2.localhost:8001/w/api.php?action=wbstackElasticSearchInit&format=json"

# You can use `jq` to "pretty-print" the JSON response
curl -sS -H "Content-Type: application/json" -X POST -d '{}' "http://site1.localhost:8001/w/api.php?action=wbstackElasticSearchInit&format=json" | jq .
curl -sS -H "Content-Type: application/json" -X POST -d '{}' "http://site2.localhost:8001/w/api.php?action=wbstackElasticSearchInit&format=json" | jq .
```

Removing the installation:
Expand All @@ -45,14 +53,9 @@ When `$wwDockerCompose` is set some special settings are used. It is set from th

### Debugging Elastic

General overview of the cluster
#### General overview of the cluster:

```
http://localhost:9200/_stats
```

Entries in the content index (Items, Lexemes) for `site1.localhost` can be found by going to the following url

```
http://localhost:9200/site1.localhost_content_first/_search
```
- Overall stats: http://localhost:9200/_stats
- Indices: http://localhost:9200/_cat/indices
- Aliases: http://localhost:9200/_aliases
- Entries in the content index (Items, Lexemes) for `site1.localhost`: http://localhost:9200/mwdb_somedb1_content_first/_search
Loading