# Reindexing

### <span class="mw-headline" id="bkmrk-reindex-files-1">Reindex files</span>

Before reindexing starts may clean up the index (this is optional)

```
 DELETE FROM lucenedatastore WHERE FieldID > 0; 
```

To reindex execute the statement below using the following parameters

- schema of the database (example: "tslive")
- file table of the solution (example: "data\_solution\_file")

```
 INSERT INTO lucenefilequeue (application,tablename,FileID) 
 SELECT 'tslive', 'data_solution_file', f.ID as FileID FROM data_solution_file as f WHERE f.IsDeleted = 0;
```

After executing the statement execute the indexing service and wait patiently

### <span class="mw-headline" id="bkmrk-rewrite-index-1">Rewrite index</span>

I case your Elastic Search is lost or corrupted it is quite easy to add the whole database to Elastic search

```
 UPDATE lucenedatastore SET IsProcessed = 0; 
```

Note this will just add all data once more - there is no indexing or OCR being carried out.

### <span class="mw-headline" id="bkmrk-reindexing-existing--1">Reindexing existing data</span>

Make sure that the application name is correct in the **applicationName**

Data can be reindexed using

```
 Backend > Admin services > Rebuild artifacts > Index blobs 
```

Optionally include the files too

```
 Backend > Admin services > Rebuild artifacts > Index files
```