Class GenericIndexDiagnostics
Used to return diagnostic data for any index
Inheritance
Namespace: Umbraco.Cms.Infrastructure.Examine
Assembly: Umbraco.Infrastructure.dll
Syntax
public class GenericIndexDiagnostics : IIndexDiagnostics, IIndexStats
Constructors
View SourceGenericIndexDiagnostics(IIndex)
Initializes a new instance of the GenericIndexDiagnostics class with the specified index.
Declaration
public GenericIndexDiagnostics(IIndex index)
Parameters
| Type | Name | Description |
|---|---|---|
| IIndex | index | The index to run diagnostics against. |
Properties
View SourceDocumentCount
Gets the count of documents in the index.
Declaration
public int DocumentCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
unknown
FieldCount
Gets the count of fields in the generic index. Returns -1 if unknown.
Declaration
public int FieldCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
unknown
Metadata
Gets a read-only dictionary containing metadata extracted from the index instance. The metadata consists of property names and their corresponding values, where the properties are those of the underlying index type, excluding any ignored properties. This metadata provides insight into the configuration and state of the index instance.
Declaration
public IReadOnlyDictionary<string, object?> Metadata { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, object> |
Methods
View SourceGetDocumentCount()
Gets the count of documents in the index.
Declaration
public long GetDocumentCount()
Returns
| Type | Description |
|---|---|
| long | The number of documents in the index, or -1 if unavailable. |
GetFieldNames()
Returns an enumerable collection of field names associated with the index.
Declaration
public IEnumerable<string> GetFieldNames()
Returns
| Type | Description |
|---|---|
| IEnumerable<string> | An System.Collections.Generic.IEnumerable<T> of field names. Currently, this implementation returns an empty collection. |
IsHealthy()
Determines whether the index is healthy by checking for its existence and verifying that a basic search query can be executed successfully.
Declaration
public Attempt<string?> IsHealthy()
Returns
| Type | Description |
|---|---|
| Attempt<string> | An Attempt<string?> that succeeds if the index is healthy, or fails with an error message if not. |