我正在尝试获取一个开放的搜索定义以在子域上工作。
我已经在html中添加了正确的行。
示例:
public async Task<bool> CreateOrupdateInstallationAsync(DeviceInstallation deviceInstallation,CancellationToken token)
{
if (string.IsnullOrWhiteSpace(deviceInstallation?.InstallationId) ||
string.IsnullOrWhiteSpace(deviceInstallation?.Platform) ||
string.IsnullOrWhiteSpace(deviceInstallation?.PushChannel))
return false;
var installation = new Installation()
{
InstallationId = deviceInstallation.InstallationId,PushChannel = deviceInstallation.PushChannel,Tags = deviceInstallation.Tags
};
if (_installationPlatform.TryGetvalue(deviceInstallation.Platform,out var platform))
installation.Platform = platform;
else
return false;
try
{
await _hub.CreateOrupdateInstallationAsync(installation,token);
}
catch
{
return false;
}
return true;
}
在opensearch.xml中:
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>title</title>
<link rel="search"
type="application/opensearchdescription+xml"
href="http://www.example.org/opensearch.xml"
title="Example" />
</head>
<body>
</body>
</html>
当我访问http://www.example.org时,搜索已正确添加到Google Chrome浏览器的多功能框设置中。触发关键字变为“ example.org”。
但是,当我访问http://subdomain.example.org时,该行与中的同一行,该搜索添加了触发关键字“ subdomain.example.org”而不是“ example.org”。
有没有解决的办法?
我在http://www.opensearch.org/Specifications/OpenSearch/1.1的文档中找不到有关如何设置触发器关键字的任何信息。
我将默认关键字更改为其他内容。 我该怎么办?