* wip * first pass at elasticsearch; movies kind of work * use field name constants * properly sort search results * fix some crashes * fix page map/jump letters * optimize page map using terms aggregation * index all item types * optionally use elastic search * code cleanup * automatically rebuild lucene index after improper shutdown * update changelog
21 lines
681 B
C#
21 lines
681 B
C#
namespace ErsatzTV;
|
|
|
|
public static class SearchHelper
|
|
{
|
|
public static string ElasticSearchUri { get; private set; }
|
|
public static string ElasticSearchIndexName { get; private set; }
|
|
public static bool IsElasticSearchEnabled { get; private set; }
|
|
|
|
public static void Init(IConfiguration configuration)
|
|
{
|
|
ElasticSearchUri = configuration["ElasticSearch:Uri"];
|
|
ElasticSearchIndexName = configuration["ElasticSearch:IndexName"];
|
|
if (string.IsNullOrWhiteSpace(ElasticSearchIndexName))
|
|
{
|
|
ElasticSearchIndexName = "ersatztv";
|
|
}
|
|
|
|
IsElasticSearchEnabled = !string.IsNullOrWhiteSpace(ElasticSearchUri);
|
|
}
|
|
}
|