index release date for searching (#93)

This commit is contained in:
Jason Dove
2021-03-21 01:49:10 +00:00
committed by GitHub
parent eca58dbe7f
commit f04c18c810
+20 -1
View File
@@ -37,6 +37,7 @@ namespace ErsatzTV.Infrastructure.Search
private const string LibraryNameField = "library_name";
private const string TitleAndYearField = "title_and_year";
private const string JumpLetterField = "jump_letter";
private const string ReleaseDateField = "release_date";
private const string MovieType = "movie";
private const string ShowType = "show";
@@ -58,7 +59,7 @@ namespace ErsatzTV.Infrastructure.Search
_logger = logger;
}
public int Version => 1;
public int Version => 2;
public Task<bool> Initialize()
{
@@ -238,6 +239,15 @@ namespace ErsatzTV.Infrastructure.Search
new StringField(JumpLetterField, GetJumpLetter(metadata), Field.Store.YES)
};
if (metadata.ReleaseDate.HasValue)
{
doc.Add(
new StringField(
ReleaseDateField,
metadata.ReleaseDate.Value.ToString("yyyyMMdd"),
Field.Store.NO));
}
if (!string.IsNullOrWhiteSpace(metadata.Plot))
{
doc.Add(new TextField(PlotField, metadata.Plot ?? string.Empty, Field.Store.NO));
@@ -282,6 +292,15 @@ namespace ErsatzTV.Infrastructure.Search
new StringField(JumpLetterField, GetJumpLetter(metadata), Field.Store.YES)
};
if (metadata.ReleaseDate.HasValue)
{
doc.Add(
new StringField(
ReleaseDateField,
metadata.ReleaseDate.Value.ToString("yyyyMMdd"),
Field.Store.NO));
}
if (!string.IsNullOrWhiteSpace(metadata.Plot))
{
doc.Add(new TextField(PlotField, metadata.Plot ?? string.Empty, Field.Store.NO));