# search.Reindexing

## Model Info

| Key | Value |
|---|-----|
| Model Name | Reindexing |
| Verbose Name | reindexing |
| Verbose Name Plural | reindexings |
| Docstring | <p>Reindexing(id, start\_date, old\_index, new\_index, alias)</p> |
| Is Abstract | False |
| Is Proxy | False |
| Is Managed | True |
| Ordering | [] |
| Permissions | [] |
| Default Permissions | ('add', 'change', 'delete', 'view') |
| Indexes | [] |
| Constraints | [] |
| Database Table | zadmin_reindexing |
| Base Manager | None |
| Default Manager | None |
| File | /data/olympia/src/olympia/search/models.py |
| Starting Line Number | 39 |
| Method Resolution Order | (<class 'olympia.search.models.Reindexing'>, <class 'django.db.models.base.Model'>, <class 'django.db.models.utils.AltersData'>, <class 'object'>) |

## Fields

| Field Name | Field Type | Database Column | Database Type | Verbose Name |
|----------|----------|---------------|-------------|------------|
| `alias` | CharField | alias | varchar(255) | alias |
| `id (pk)` | AutoField | id | integer AUTO_INCREMENT | ID |
| `new_index` | CharField | new_index | varchar(255) | new index |
| `old_index` | CharField | old_index | varchar(255) | old index |
| `start_date` | DateTimeField | start_date | datetime(6) | start date |

fields_reverse_relation=[]

## Methods

### Other Methods

| Method Name | Signature |
|-----------|---------|
| `get_next_by_start_date` | `(self, *, field=<django.db.models.fields.DateTimeField: start_date>, is_next=True, **kwargs)` |
| `get_previous_by_start_date` | `(self, *, field=<django.db.models.fields.DateTimeField: start_date>, is_next=False, **kwargs)` |


### Private Methods

| Method Name | Signature |
|-----------|---------|
| `_get_field_value_map` | `(self, meta, exclude=None)` |


## Custom Managers

### default

**Class:** `ReindexingManager`

*Used to flag when an elasticsearch reindexing is occurring.*

#### Custom Methods

##### `flag_reindexing(self, new_index, old_index, alias)`

*Flag the database for a reindex*

##### `get_indices(self, index)`

*Return the indices associated with an alias.

If we are reindexing, there should be two indices returned.*

##### `is_reindexing(self)`

*Return True if a reindexing is occurring.*

##### `unflag_reindexing(self)`

*Unflag the database for a reindex.*

### objects

**Class:** `ReindexingManager`

*Used to flag when an elasticsearch reindexing is occurring.*

#### Custom Methods

##### `flag_reindexing(self, new_index, old_index, alias)`

*Flag the database for a reindex*

##### `get_indices(self, index)`

*Return the indices associated with an alias.

If we are reindexing, there should be two indices returned.*

##### `is_reindexing(self)`

*Return True if a reindexing is occurring.*

##### `unflag_reindexing(self)`

*Unflag the database for a reindex.*


---

!!! THIS DOCUMENT WAS *AUTOGENERATED* ON 2025-08-04 !!!