-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
788b858
commit a258574
Showing
4 changed files
with
184 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Microsoft.KernelMemory; | ||
using System.Collections.Generic; | ||
|
||
namespace KernelMemory.ElasticSearch; | ||
|
||
public class ExtendedMemoryFilter : MemoryFilter | ||
{ | ||
/// <summary> | ||
/// This collection of tags contains all the tags that are used to | ||
/// negatively filter out memory records. | ||
/// </summary> | ||
private TagCollection _notTags = new(); | ||
Check warning on line 12 in src/KernelMemory.ElasticSearch/ExtendedMemoryFilter.cs GitHub Actions / Build and analyze
|
||
|
||
public MemoryFilter ByNotTag(string name, string value) | ||
{ | ||
this._notTags.Add(name, value); | ||
return this; | ||
} | ||
|
||
/// <summary> | ||
/// Gets all the filters that needs to be put as not into the query | ||
/// </summary> | ||
/// <returns></returns> | ||
public IEnumerable<KeyValuePair<string, string?>> GetNotFilters() | ||
{ | ||
return this._notTags.ToKeyValueList(); | ||
} | ||
} |