Browse Source

(Docs module)Full-Text Search(Elastic Search)

pull/3073/head
maliming 7 years ago
parent
commit
47d55f3389
  1. 26
      docs/en/Modules/Docs.md
  2. 24
      docs/zh-Hans/Modules/Docs.md

26
docs/en/Modules/Docs.md

@ -572,6 +572,32 @@ The upper sample `JSON` file renders the below navigation menu as `HTML`.
Finally a new Docs Module is added to your project which is feeded with GitHub. Finally a new Docs Module is added to your project which is feeded with GitHub.
## Full-Text Search(Elastic Search)
The Docs module supports full-text search using Elastic Search. It is not enabled by default. You can configure `DocsElasticSearchOptions` to enable it.
```
Configure<DocsElasticSearchOptions>(options =>
{
options.Enable = true;
options.IndexName = "your_index_name"; //default IndexName is abp_documents
});
```
The `Index` is automatically created after the application starts if the `Index` does not exist.
`DefaultElasticClientProvider` is responsible for creating `IElasticClient`. By default, it reads Elastic Search's `Url` from `IConfiguration`.
If your `IElasticClient` needs additional configuration, please use override `IElasticClientProvider` service and replace it in the [dependency injection](Dependency-Injection.md) system.
```
{
"ElasticSearch": {
"Url": "http://localhost:9200"
}
}
```
## Next ## Next
Docs Module is also available as a standalone application. Check out [VoloDocs](../Apps/VoloDocs). Docs Module is also available as a standalone application. Check out [VoloDocs](../Apps/VoloDocs).

24
docs/zh-Hans/Modules/Docs.md

@ -572,6 +572,30 @@ This document assumes that you prefer to use **{{ UI_Value }}** as the UI framew
最后,为您的项目添加了一个新的Docs模块, 该模块由GitHub提供. 最后,为您的项目添加了一个新的Docs模块, 该模块由GitHub提供.
## 全文搜索(Elastic Search)
文档模块支持使用Elastic Search对内容进行全文搜索. 默认没有启用, 你可以配置`DocsElasticSearchOptions`启用它.
```
Configure<DocsElasticSearchOptions>(options =>
{
options.Enable = true;
options.IndexName = "your_index_name"; //default IndexName is abp_documents
});
```
应用程序启动后如果`Index`不存在则会自动创建`Index`.
`DefaultElasticClientProvider`负责创建`IElasticClient`, 默认情况下它会从`IConfiguration`中读取Elastic Search的`Url`.
如果你的IElasticClient需要其它配置请使用重写IElasticClientProvider服务并在依赖注入系统中替换它.
```
{
"ElasticSearch": {
"Url": "http://localhost:9200"
}
}
```
## 下一步 ## 下一步
文档模块也可以做为独立的应用程序. 查看 [VoloDocs](../Apps/VoloDocs). 文档模块也可以做为独立的应用程序. 查看 [VoloDocs](../Apps/VoloDocs).
Loading…
Cancel
Save