Skip to content

Commit

Permalink
隐藏IndexId字段
Browse files Browse the repository at this point in the history
  • Loading branch information
ldqk committed Oct 24, 2022
1 parent bf790df commit 920772c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface ILuceneIndexable
/// </summary>
[LuceneIndex(Name = "IndexId", Store = Field.Store.YES)]
[JsonIgnore, NotMapped]
string IndexId { get; set; }
internal string IndexId { get; set; }

/// <summary>
/// 转换成Lucene文档
Expand Down
6 changes: 3 additions & 3 deletions Masuit.LuceneEFCore.SearchEngine/LuceneIndexableBaseEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public abstract class LuceneIndexableBaseEntity : ILuceneIndexable
/// <summary>
/// 索引唯一id
/// </summary>
[LuceneIndex(Name = nameof(IndexId), Store = Field.Store.YES)]
[LuceneIndex(Name = nameof(ILuceneIndexable.IndexId), Store = Field.Store.YES)]
[NotMapped, JsonIgnore]
public string IndexId
string ILuceneIndexable.IndexId
{
get => LuceneIndexerOptions.IndexIdGenerator(GetType(), Id);

Expand Down Expand Up @@ -73,7 +73,7 @@ public virtual Document ToDocument()

//1. 该处修复用IndexId去删除索引无效的问题
//2. 以Id为目标的删除放在其他处: 也利用到了IndexId
if (propertyInfo.Name == nameof(IndexId))
if (propertyInfo.Name == nameof(ILuceneIndexable.IndexId))
{
var filed = new Field(propertyInfo.Name, propertyValue.ToString(), new FieldType
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Copyright>懒得勤快</Copyright>
<PackageProjectUrl>https://github.com/ldqk/Masuit.LuceneEFCore.SearchEngine</PackageProjectUrl>
<PackageId>Masuit.LuceneEFCore.SearchEngine_int</PackageId>
<Version>1.2</Version>
<Version>1.2.1</Version>
<Configurations>Debug;Release;String版本;Guid版本;Long版本</Configurations>
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
<RunAnalyzersDuringLiveAnalysis>false</RunAnalyzersDuringLiveAnalysis>
Expand Down

0 comments on commit 920772c

Please sign in to comment.