index.html 2.4 KB
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>电商搜索引擎 - SearchEngine Demo</title>
    <link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
    <div class="container">
        <header>
            <h1>🔍 电商搜索引擎</h1>
            <p class="subtitle">E-Commerce Search Engine - Customer1 Demo</p>
        </header>

        <div class="search-section">
            <div class="search-box">
                <input type="text" id="searchInput" placeholder="输入搜索关键词... (支持中文、英文、俄文)"
                       onkeypress="handleKeyPress(event)">
                <button onclick="performSearch()" class="search-button">搜索</button>
            </div>

            <div class="search-options">
                <label><input type="checkbox" id="enableTranslation" checked> 启用翻译</label>
                <label><input type="checkbox" id="enableEmbedding" checked> 启用语义搜索</label>
                <label><input type="checkbox" id="enableRerank" checked> 启用自定义排序</label>
                <select id="resultSize">
                    <option value="10">10条结果</option>
                    <option value="20">20条结果</option>
                    <option value="50">50条结果</option>
                </select>
            </div>

            <div class="search-examples">
                <strong>搜索示例:</strong>
                <button class="example-btn" onclick="setQuery('芭比娃娃')">芭比娃娃</button>
                <button class="example-btn" onclick="setQuery('toy AND (barbie OR doll)')">布尔查询</button>
                <button class="example-btn" onclick="setQuery('消防')">消防</button>
                <button class="example-btn" onclick="setQuery('fire control set')">英文查询</button>
            </div>
        </div>

        <div id="loading" class="loading" style="display: none;">
            <div class="spinner"></div>
            <p>搜索中...</p>
        </div>

        <div id="results" class="results-section"></div>

        <div id="queryInfo" class="query-info"></div>
    </div>

    <footer>
        <p>SearchEngine © 2025 | API服务地址: <span id="apiUrl">http://120.76.41.98:6002</span></p>
    </footer>

    <script src="/static/js/app.js?v=2.0"></script>
</body>
</html>