From cbc68da704815255a618ee98dfdbbb14cdeb7ad2 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Thu, 28 Dec 2023 15:14:39 -0800 Subject: [PATCH] Update Elasticsearch and Lucene docs --- .../reference/modules/Elasticsearch/README.md | 12 +- src/docs/reference/modules/Lucene/README.md | 116 ++++++++++++++++++ 2 files changed, 122 insertions(+), 6 deletions(-) diff --git a/src/docs/reference/modules/Elasticsearch/README.md b/src/docs/reference/modules/Elasticsearch/README.md index 4f5ec84dedb..63affe55328 100644 --- a/src/docs/reference/modules/Elasticsearch/README.md +++ b/src/docs/reference/modules/Elasticsearch/README.md @@ -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. @@ -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" @@ -125,7 +125,7 @@ To reset all indices: { "steps":[ { - "name":"lucene-index-reset", + "name":"elastic-index-reset", "IncludeAll":true } ] @@ -141,7 +141,7 @@ Deletes and recreates the full index content. { "steps":[ { - "name":"lucene-index-rebuild", + "name":"elastic-index-rebuild", "Indices":[ "IndexName1", "IndexName2" @@ -157,7 +157,7 @@ To rebuild all indices: { "steps":[ { - "name":"lucene-index-rebuild", + "name":"elastic-index-rebuild", "IncludeAll":true } ] @@ -214,7 +214,7 @@ See: +## 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.