IndexingService.cs 839 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Best.HTTP.Shared.Databases
  4. {
  5. public abstract class IndexingService<ContentType, MetadataType> where MetadataType : Metadata
  6. {
  7. /// <summary>
  8. /// Index newly added metadata
  9. /// </summary>
  10. public virtual void Index(MetadataType metadata) { }
  11. /// <summary>
  12. /// Remove metadata from all indexes.
  13. /// </summary>
  14. public virtual void Remove(MetadataType metadata) { }
  15. /// <summary>
  16. /// Clear all indexes
  17. /// </summary>
  18. public virtual void Clear() { }
  19. /// <summary>
  20. /// Get indexes in an optimized order. This is usually one of the indexes' WalkHorizontal() call.
  21. /// </summary>
  22. public virtual IEnumerable<int> GetOptimizedIndexes() => null;
  23. }
  24. }