Fulltext Search Example
This example demonstrates how to build a E-commerce product search application using TiDB's full-text search feature with multilingual support. Users can search for products by keywords in their preferred language.
E-commerce product search with full-text search
Prerequisites
- Python 3.10+
- A TiDB Cloud Serverless cluster: Create a free cluster here: tidbcloud.com ↗️
How to run
Step 1: Clone the repository to local
Step 2: Install the required packages and setup environment
Step 3: Set up environment to connect to database
Go to the TiDB Cloud console, create a new cluster if you don't have one, and then get the connection parameters on the connection dialog.
cat > .env <<EOF
TIDB_HOST={gateway-region}.prod.aws.tidbcloud.com
TIDB_PORT=4000
TIDB_USERNAME={prefix}.root
TIDB_PASSWORD={password}
TIDB_DATABASE=pytidb_fulltext_demo
EOF
Step 4: Run the Streamlit app
Step 5: open the browser and visit http://localhost:8501
Related Resources
- Source Code: View on GitHub
-
Category: Search
-
Description: Perform traditional text search using MySQL fulltext search capabilities.