---
# System prepended metadata

title: class things_index

---

# class things_index

```
class things_index(...)
    [...]
    def __get_things_indexes_from_ES(self):
        # recupera gli indici che iniziano per things da ElasticSearch
        indexes = es_client.indices.get_alias("things*")
        return indexes

    def check_reindex_is_running(self):
        indexes = self.__get_things_indexes_from_ES()
        if len(indexes) == 2:
            indexes.sort()
            return True, indexes[0], indexes[1]
        else:
            return None, None, None

thingindex = thing_index()
reindex_is_running, current_index, new_index = thingindex.check_reindex_is_running()

if reindex_is_running:
    scrivi su current_index e new_index
else:
    continua normalmente
```
