opensearch并未显示全部建议

我正在使用django创建一个具有搜索引擎的网站。我添加了opensearch,以便在搜索栏中输入搜索提示。但是opensearch并未显示我的网站提出的全部建议。我已将opensearch添加到html中,如下所示:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <link rel="search" href="https://example.com/static/commons/opensearch.xml"
        type="application/opensearchdescription+xml"
        title="example" />
    <title>
        {% block title %}
            {{ query|default_if_none:'example' }}
        {% endblock %}
    </title>
...

opensearch.xml的内容在这里:

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                   xmlns:moz="http://www.mozilla.org/2006/browser/search/">
    <ShortName>Example</ShortName>
    <Description>Example Search Engine</Description>
    <InputEncoding>[UTF-8]</InputEncoding>
    <Image width="16" height="16" type="image/x-icon">https://example.com/static/commons/img/favicon.ico</Image>
    <Url type="text/html" template="https://example.com/search">
        <Param name="query" value="{searchTerms}"/>
    </Url>
    <Url type="application/x-suggestions+json" 
         template="https://example.com/meta_search/get_suggestions/?query={searchTerms}"/>
    <moz:SearchForm>https://example.com</moz:SearchForm>
</OpenSearchDescription>

我的网络服务器每个查询返回大约10条建议(例如'mov'),如下所示:

["mov",["movies 2019","movie","moviebaz","movie98","movies 2018","movie download","movie maker","movies 2017","movies to watch","movie 43"]]

但是google-chrome通常在这样的列表中仅显示1或2个第一建议:

opensearch并未显示全部建议

但是Google每次查询显示5条或更多建议。像这样:

opensearch并未显示全部建议

我试图找到Google opensearch.xml,但是它没有任何<link ...标签,而且我不知道Google如何添加opensearch

如何修复我的网站以在搜索栏中显示更多搜索建议?

xiaomo1128 回答:opensearch并未显示全部建议

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2877814.html

大家都在问