Skip to content

Commit 71fa852

Browse files
authored
docs: refactor search example (#27)
1 parent f5ee15f commit 71fa852

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

examples/embedding_search/README.md renamed to examples/search/README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,31 @@ source .venv/bin/activate
4545
pip install -r reqs.txt
4646
```
4747

48-
**Step3**: Run the Streamlit app
48+
**Step3**: Set up environment to connect to storage
49+
If you are using TiDB Cloud, you'd better set up the environment variable `DATABASE_URL` to connect to the TiDB Cloud database. You can find the connection string in the [TiDB Cloud console](https://tidbcloud.com/).
50+
51+
```bash
52+
cat > .env <<EOF
53+
DATABASE_URL="mysql+pymysql://<username>:<password>@<host>:4000/test?ssl_verify_cert=true&ssl_verify_identity=true"
54+
EOF
55+
```
56+
57+
If you are using a local TiDB server, you can set up the environment variable like this:
58+
59+
```bash
60+
cat > .env <<EOF
61+
TIDB_HOST=localhost
62+
TIDB_PORT=4000
63+
TIDB_USERNAME=root
64+
TIDB_PASSWORD=
65+
TIDB_DATABASE=test
66+
EOF
67+
```
68+
69+
**Step4**: Run the Streamlit app
4970

5071
```bash
5172
streamlit run main.py
5273
```
5374

54-
**Step4**: open the browser and visit `http://localhost:8501`
75+
**Step5**: open the browser and visit `http://localhost:8501`
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)