IndexValidator
class provides static validation methods for index components, ensuring that spaces, fields, effects, and exclusion fields are properly configured and compatible with the index system.
Methods
validate_effects
Parameters
The effect or sequence of effects to validate. Can be a single Effect, a sequence of Effects, or None.
The sequence of spaces that the effects should be validated against.
Returns
A validated list of Effect objects that are compatible with the provided spaces.
validate_fields
Parameters
The field or sequence of fields to validate. Can be a single SchemaField, a sequence of SchemaFields (with possible None values), or None.
Returns
A validated sequence of SchemaField objects with None values filtered out.
validate_fields_to_exclude
Parameters
The field or sequence of fields to exclude from the index. Can be a single SchemaField, a sequence of SchemaFields (with possible None values), or None.
Returns
A validated sequence of SchemaField objects that should be excluded from the index.
validate_spaces
Parameters
The space or sequence of spaces to validate. Can be a single Space or a sequence of Space objects.
Returns
A validated list of Space objects that are properly configured for use in an index.
Usage
TheIndexValidator
class is typically used internally by the index system to ensure that all components are properly validated before being used in an index configuration. All methods are static and can be called directly on the class without instantiation.
These validation methods help ensure data integrity and compatibility within the index system by validating spaces, fields, and effects before they are used in index operations.