Skip to content

Lucene (OrchardCore.Lucene)

Lucene(OrchardCore.Lucene)

The Lucene module allows to manage Lucene indices.

Lucene模块允许管理Lucene索引。

Recipe step

食谱步骤

Lucene indices can be created during recipe execution using the lucene-index step.

可以使用lucene-index步骤在配方执行期间创建Lucene索引。

Here is a sample step:

这是一个示例步骤:


{

 <font color=#0099ff size=4 face="黑体">{</font> 


    "name": "lucene-index",

    "Indices": "Indices": [ "Search" ]

}

 <font color=#0099ff size=4 face="黑体">}</font> 


Queries recipe step

查询配方步骤

Here is an example for creating a Lucene query from a Queries recipe step:

以下是从查询配方步骤创建Lucene查询的示例:


{

 <font color=#0099ff size=4 face="黑体">{</font> 


    "Source": "Lucene",

    "Name": "RecentBlogPosts",

    "Index": "Search",

    "Template": "...", // json encoded query template

    "ReturnContentItems": true

}

 <font color=#0099ff size=4 face="黑体">}</font> 


Web APIs

Web API

api/lucene/content

API / Lucene的/内容

Executes a query with the specified name and returns the corresponding content items.

执行具有指定名称的查询并返回相应的内容项。

Verbs: POST and GET

动词: POST GET

| Parameter | Example | Description |

|参数|示例|说明|

| --------- | ---- |------------ |

| --------- | ---- | ------------ |

| indexName | search | The name of the index to query |

| indexName | search |要查询的索引的名称

| query | { "query": { "match_all": {} } } | A Json object representing the query |

| query | {“query”:{“match_all”:{}}}|表示查询的Json对象

| parameters | { size: 3} | A Json object representing the parameters of the query |

| parameters | {size:3}|一个Json对象,表示查询的参数

api/lucene/documents

API / Lucene的/文件

Executes a query with the specified name and returns the corresponding Lucene documents.

执行具有指定名称的查询并返回相应的Lucene文档。

Only the stored fields are returned.

仅返回存储的字段。

Verbs: POST and GET

动词: POST GET

| Parameter | Example | Description |

|参数|示例|说明|

| --------- | ---- |------------ |

| --------- | ---- | ------------ |

| indexName | search | The name of the index to query |

| indexName | search |要查询的索引的名称

| query | { "query": { "match_all": {} } } | A Json object representing the query |

| query | {“query”:{“match_all”:{}}}|表示查询的Json对象

| parameters | { size: 3} | A Json object representing the parameters of the query |

| parameters | {size:3}|一个Json对象,表示查询的参数

Lucene Worker (OrchardCore.Lucene.Worker)

Lucene Worker(OrchardCore.Lucene.Worker)

This feature creates a background task that will keep the local file system index synchronized with

此功能创建一个后台任务,以保持本地文件系统索引与之同步

other instances that could have their own local index. It is recommended to use it only if you are

其他可以拥有自己的本地索引的实例。建议仅在您使用时使用它

running the same tenant on multiple instances (farm) and are using a Lucene file system index.

在多个实例(服务器场)上运行相同的租户并使用Lucene文件系统索引。

If you are running on Azure App Services or if you are using Elasticsearch, then you don't need this

如果您在Azure App Services上运行,或者如果您使用的是Elasticsearch,则不需要此操作

feature.

特征。

CREDITS

学分

Lucene.net

Lucene.net

http://lucenenet.apache.org/index.html

http://lucenenet.apache.org/index.html

Copyright 2013 The Apache Software Foundation

版权所有2013 The Apache Software Foundation

Licensed under the Apache License, Version 2.0.

根据Apache许可证2.0版获得许可。