Skip to content

Orchard Core 1.5.0

发布日期:2022年10月

该版本包含安全漏洞修复。建议您使用此版本更新现有的 Orchard Core 部署。

Breaking Changes

  • OrchardCore_Media_AmazonS3 配置节已更改:RegionEndpoint 更名为 Region 并从 Credentials 节中提取到 OrchardCore_Media_AmazonS3 的根节中,AccessKeyId 更名为 AccessKeyProfileName 更名为 Profile。有关详细信息,请参见此拉取请求

  • Lucene 的破坏性更改。有关详细信息,请参见此拉取请求

ISearchQueryService 移动到 OrchardCore.Search.Lucene.Abstractions 模块,成为 ILuceneSearchQueryService。现在,OrchardCore.Search 模块将考虑多个搜索提供程序实现。

Lucene 迁移

手动迁移以恢复 Lucene 索引设置、部署计划和查询。(仅供参考)

  UPDATE Document SET Content = REPLACE(content, '\"$type\":\"OrchardCore.Lucene.Deployment.LuceneIndexDeploymentStep, OrchardCore.Lucene\"', '\"$type\":\"OrchardCore.Search.Lucene.Deployment.LuceneIndexDeploymentStep, OrchardCore.Search.Lucene\"')
## Lucene 重大变更

如果您的站点使用了 Lucene 搜索模块,并且在升级到 Orchard Core CMS 1.0.0 及更高版本时发现搜索不工作,则可能需要执行以下 SQL 脚本。

请注意,在执行此脚本之前,应该备份数据库。此外,只有在您的 Orchard Core 实例中确实存在 Lucene 搜索模块时才应该运行此脚本。

```sql
WHERE [Type] = 'OrchardCore.Deployment.DeploymentPlan, OrchardCore.Deployment.Abstractions'

UPDATE Document SET Content = REPLACE(content, '\"$type\":\"OrchardCore.Lucene.Deployment.LuceneSettingsDeploymentStep, OrchardCore.Lucene\"', '\"$type\":\"OrchardCore.Search.Lucene.Deployment.LuceneSettingsDeploymentStep, OrchardCore.Search.Lucene\"')
WHERE [Type] = 'OrchardCore.Deployment.DeploymentPlan, OrchardCore.Deployment.Abstractions'

UPDATE Document SET Content = REPLACE(content, '\"$type\":\"OrchardCore.Lucene.Deployment.LuceneIndexResetDeploymentStep, OrchardCore.Lucene\"', '\"$type\":\"OrchardCore.Search.Lucene.Deployment.LuceneIndexResetDeploymentStep, OrchardCore.Search.Lucene\"')
WHERE [Type] = 'OrchardCore.Deployment.DeploymentPlan, OrchardCore.Deployment.Abstractions'

UPDATE Document SET Content = REPLACE(content, '\"$type\":\"OrchardCore.Lucene.Deployment.LuceneIndexRebuildDeploymentStep, OrchardCore.Lucene\"', '\"$type\":\"OrchardCore.Search.Lucene.Deployment.LuceneIndexRebuildDeploymentStep, OrchardCore.Search.Lucene\"')
WHERE [Type] = 'OrchardCore.Deployment.DeploymentPlan, OrchardCore.Deployment.Abstractions'

UPDATE Document SET Content = REPLACE(content, '"$type":"OrchardCore.Lucene.LuceneQuery, OrchardCore.Lucene"', '"$type":"OrchardCore.Search.Lucene.LuceneQuery, OrchardCore.Search.Lucene"')
WHERE  [Type] = 'OrchardCore.Queries.Services.QueriesDocument, OrchardCore.Queries'

UPDATE Document SET [Type] = 'OrchardCore.Search.Lucene.Model.LuceneIndexSettingsDocument, OrchardCore.Search.Lucene'
WHERE [Type] = 'OrchardCore.Lucene.Model.LuceneIndexSettingsDocument, OrchardCore.Lucene'

以上脚本将更新数据库中的数据,以遵循 Lucene 搜索模块的最新要求。执行此脚本后,应该能够正常使用搜索功能。

模块重命名

将模块从OrchardCore.Lucene重命名为OrchardCore.Search.Lucene。请更新你的配方文件和扩展清单中的依赖声明。

IndexingConstants更改:

常量 之前 之后
DisplayTextKey Content.ContentItem.DisplayText Content.ContentItem.DisplayText.keyword
ContainedPartKey + IdsKey (new) Content.ContentItem.ContainedPart.ListContentItemId Content.ContentItem.ContainedPart.Ids

分类法模块索引

你现在可以通过使用"{ContentTypeName}.{FieldName}.Ids"访问分类法字段的术语 ID。

查询迁移

Elasticsearch会自动映射数据,这意味着文本字段将始终被“分词”。您现在可以通过在字段名称后缀中使用.keyword来访问该文本字段的“Stored”值。这意味着您现在可以在.keyword字段上使用“TermQuery”,在基本字段名称上使用“MatchQuery”。请参阅Elasticsearch vs Lucene

权限

将 ManageIndexes 现在更改为 ManageLuceneIndexes。

Lucene 索引

之前 现在 操作
Indexed Indexed Indexed 在 Lucene 中表示“关键字”,所以我们将这些迁移到内容索引设置中的“关键字”。
Analyzed Keyword “分析”选项已被移除。设置为“分析”的所有内容都不需要迁移,因为现在它已经是默认选项。
Stored Stored 无需操作。应该与之前一样工作。

YesSQL 的破坏性更改

YesSql 现在使用新的 SQL 客户端,默认加密连接。

如果 SQL Server 没有受信任的 SSL 证书,您仍想继续使用不受信任服务器的加密通信,请将 TrustServerCertificate=True 添加到连接字符串中。

如果您不想加密通信,则可以使用 Encrypt=false

该文档由Chat-GPT 翻译


Last update: March 22, 2023