Using ElasticKit Library

The PopForums.ElasticKit library makes it possible to wire up the following scenarios:

  • Use ElasticSearch for search instead of the built-in search indexing. Important: The client library referenced in v15.x is designed to work against v6.x of ElasticSearch, while v16.x,v17.x and v18.x, v19.x uses v7.x of ElasticSearch. v20.x and v21.x uses v8.x of ElasticSearch. v22.x uses v9.x of ElasticSearch. For prior versions, please see the docs folder in those branches. Configuration is significantly different for >=v22.1, and is a breaking change.

ElasticSearch can run quite literally anywhere in a docker container or straight up in a VM, if that’s your thing. Also keep in mind that the implementation that AWS uses is actually a fork, so there are some differences about how the managed service is, uh, managed. Elastic runs in all of the major clouds and is generally reasonably priced.

Configuration with Azure App Services and Azure Functions

The POP Forums configuration system uses the appsettings.json file, but adhere’s to the overriding system implemented via environment variables. This by extension means that you can set these values in the Application Settings section of the Azure portal for App Services and Functions. It uses the colon notation that you may be familiar with. For example, use PopForums:Queue:ConnectionString to correspond to the hierarchy of the appsettings.json file. (For Linux-based App Services and Functions in Azure, use a double underscore instead of colons in the portal settings, i.e., PopForums__Queue__ConnectionString.)

Irrelevant admin settings when using ElasticKit

  • In search: The search indexing interval only reacts when something is queued for in-Web processing, not Azure Functions. Furthermore, if you use ElasticSearch, the junk words no longer apply, as these indexing strategies are handled by ES.

ElasticSearch is a search engine you can run on your own or in managed services from AWS, Elastic and others. To use this service instead of the internal POP Forums search indexing, add this line to your Program.cs:

using PopForums.ElasticKit;
...
namespace YourWebApp;

...
services.AddPopForumsElasticSearch();

If you run background work in Azure Functions, add the same line to the functions host’s Program.cs, because the functions build the search index.

You’ll also need to set these configuration values in both hosts:

{
  "PopForums": {
    "Search": {
      "Url": "https://myelasticsearchindex",
      "Key": ""
    },
  • Url: The base URL for the ElasticSearch endpoints. If you’re using managed ES from Elastic, this is the “ElasticSearch Copy endpoint” result in the portal.
  • Key: This is the API key. Leave it blank if your ElasticSearch instance doesn’t require authentication.

Configuring ElasticSearch and setting up security rules for it are beyond the scope of this wiki.


©2025, POP World Media, LLC