Skip to content

Commit

Permalink
Update Elasticsearch and Lucene docs (OrchardCMS#14963)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored and urbanit committed Mar 18, 2024
1 parent 4257bc1 commit 853c47d
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/docs/reference/modules/Elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You should get this result in Docker Desktop app:

### Set up Elasticsearch in Orchard Core

- Add Elastic Connection in the shell configuration (OrchardCore.Cms.Web appsettings.json file). [See Elasticsearch Configurations](#elasticsearch-configuration).
- Add Elastic Connection in the shell configuration (OrchardCore.Cms.Web `appsettings.json` file). [See Elasticsearch Configurations](#elasticsearch-configuration).

- Start an Orchard Core instance with VS Code debugger
- Go to Orchard Core features, Enable Elasticsearch.
Expand Down Expand Up @@ -109,7 +109,7 @@ It doesn't delete existing entries from the index.
{
"steps":[
{
"name":"lucene-index-reset",
"name":"elastic-index-reset",
"Indices":[
"IndexName1",
"IndexName2"
Expand All @@ -125,7 +125,7 @@ To reset all indices:
{
"steps":[
{
"name":"lucene-index-reset",
"name":"elastic-index-reset",
"IncludeAll":true
}
]
Expand All @@ -141,7 +141,7 @@ Deletes and recreates the full index content.
{
"steps":[
{
"name":"lucene-index-rebuild",
"name":"elastic-index-rebuild",
"Indices":[
"IndexName1",
"IndexName2"
Expand All @@ -157,7 +157,7 @@ To rebuild all indices:
{
"steps":[
{
"name":"lucene-index-rebuild",
"name":"elastic-index-rebuild",
"IncludeAll":true
}
]
Expand Down Expand Up @@ -214,7 +214,7 @@ See: <https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.

## Elasticsearch configuration

The Elasticsearch module connection configuration can be set globally in the appsettings.json file or per tenant.
The Elasticsearch module connection configuration can be set globally in the `appsettings.json` file or per tenant.

```json
"OrchardCore_Elasticsearch": {
Expand Down
116 changes: 116 additions & 0 deletions src/docs/reference/modules/Lucene/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,122 @@ If you are running on Azure App Services or if you are using Elasticsearch, then
The Lucene module provides a management UI and APIs for querying Lucene data using ElasticSearch Queries.
See: <https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html>

## Recipe step

Lucene indices can be created during recipe execution using the `ElasticIndexSettings` step.
Here is a sample step:

```json
{
"steps":[
{
"name":"LuceneIndexSettings",
"Indices":[
{
"Search":{
"AnalyzerName":"standardanalyzer",
"IndexLatest":false,
"Culture":"",
"StoreSourceData":false,
"IndexedContentTypes":[
"Article",
"BlogPost"
]
}
}
]
}
]
}
```

## Lucene settings recipe step

Here is an example for setting default search settings:

```json
{
"steps":[
{
// Create the search settings.
"name":"Settings",
"LuceneSettings":{
"SearchIndex":"search",
"DefaultSearchFields":[
"Content.ContentItem.FullText"
],
"AllowLuceneQueriesInSearch":false
}
}
]
}
```

### Reset Lucene Index Step

This Reset Index Step resets an Lucene index.
Restarts the indexing process from the beginning in order to update current content items.
It doesn't delete existing entries from the index.

```json
{
"steps":[
{
"name":"lucene-index-reset",
"Indices":[
"IndexName1",
"IndexName2"
]
}
]
}
```

To reset all indices:

```json
{
"steps":[
{
"name":"lucene-index-reset",
"IncludeAll":true
}
]
}
```

### Rebuild Lucene Index Step

This Rebuild Index Step rebuilds an Lucene index.
Deletes and recreates the full index content.

```json
{
"steps":[
{
"name":"lucene-index-rebuild",
"Indices":[
"IndexName1",
"IndexName2"
]
}
]
}
```

To rebuild all indices:

```json
{
"steps":[
{
"name":"lucene-index-rebuild",
"IncludeAll":true
}
]
}
```

### Query Filters

Query filters are used to retrieve records from Lucene without taking care of the boost values on them. So, it is retrieving records just like a SQL database would do.
Expand Down

0 comments on commit 853c47d

Please sign in to comment.