Add AI search query expansion
This commit is contained in:
@@ -20,7 +20,31 @@
|
||||
</form>
|
||||
</section>
|
||||
|
||||
{% if query and ai_available %}
|
||||
<section class="card" style="margin-top: 8px;">
|
||||
{% if ai_activated %}
|
||||
<span class="muted">AI 搜索已启用</span>
|
||||
{% else %}
|
||||
<a href="/search?q={{ query | urlencode }}&ai=1" class="button button-secondary" style="display:inline-block; text-decoration:none;">
|
||||
AI 智能搜索
|
||||
</a>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if searched %}
|
||||
{% if ai_error %}
|
||||
<section class="card" style="margin-top: 8px; border-color: #b42318;">
|
||||
<p style="margin:0; color: #b42318;"><strong>{{ ai_error }}</strong></p>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if ai_activated and expanded_terms %}
|
||||
<section class="card" style="margin-top: 8px; border-color: #0b57d0;">
|
||||
<p style="margin:0; color: #0b57d0;"><strong>AI 帮你扩展了:</strong>{{ expanded_terms | join('、') }}</p>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if results %}
|
||||
<section class="stack">
|
||||
<p class="muted">共找到 {{ results|length }} 条结果。</p>
|
||||
|
||||
Reference in New Issue
Block a user