Skip to content

Commit 274cf15

Browse files
committed
Update readme
1 parent 1870110 commit 274cf15

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

example-apps/workplace-search/README.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,9 @@ curl https://codeload.github.com/elastic/elasticsearch-labs/tar.gz/main | \
1313
tar -xz --strip=2 elasticsearch-labs-main/example-apps/workplace-search
1414
```
1515

16-
## 2. Index Data
16+
## 2. Credentials
1717

18-
You can index the data from the provided .json files by following the [README](./example-data/README.md) instructions in the `example-data` folder. At the moment indexing your own data should be possible. The UI will attempt to use the URL in the data file for the HTML link to the source.
19-
20-
### Loading your own data
21-
22-
See the [medicare](./example-data/README.md#loading-custom-data) example in the example-data folder for loding your own data.
23-
24-
## 3. Credentials
25-
26-
Requires the following environment variables to be set.
18+
This app requires the following environment variables to be set:
2719

2820
```sh
2921
export ELASTIC_CLOUD_ID=...
@@ -34,6 +26,15 @@ export OPENAI_API_KEY=...
3426

3527
Note: you can get your OpenAI key from the [OpenAI dashboard](https://platform.openai.com/account/api-keys).
3628

29+
30+
## 3. Index Data
31+
32+
You can index the data from the provided .json files in the `data` folder:
33+
34+
```sh
35+
python data/index-data.py
36+
```
37+
3738
## Developing
3839

3940
With the environment variables set, you can run the following commands to start the server and frontend.
@@ -45,18 +46,33 @@ With the environment variables set, you can run the following commands to start
4546

4647
### Install the dependencies
4748

49+
For Python we recommend using a virtual environment.
50+
51+
_ℹ️ Here's a good [primer](https://realpython.com/python-virtual-environments-a-primer) on virtual environments from Real Python._
52+
4853
```sh
54+
# Create a virtual environment
55+
python -m venv venv
56+
57+
# Activate the virtual environment
58+
source venv/bin/activate
59+
```
60+
61+
```sh
62+
# Install Python dependencies
4963
pip install -r requirements.txt
64+
65+
# Install Node dependencies
5066
cd frontend && yarn
5167
```
5268

5369
### Run API and frontend
5470

5571
```sh
72+
# Launch API app
5673
python api/app.py
5774

58-
# in a separate terminal
59-
75+
# In a separate terminal launch frontend app
6076
cd frontend && yarn start
6177
```
6278

0 commit comments

Comments
 (0)