Browse Source

index release date for searching (#93)

pull/94/head v0.0.22-prealpha
Jason Dove 5 years ago committed by GitHub
parent
commit
f04c18c810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      ErsatzTV.Infrastructure/Search/SearchIndex.cs

21
ErsatzTV.Infrastructure/Search/SearchIndex.cs

@ -37,6 +37,7 @@ namespace ErsatzTV.Infrastructure.Search @@ -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 @@ -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 @@ -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 @@ -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));

Loading…
Cancel
Save