Handling the case when the database is empty

Hi all, I'm using elasticsearch for my application, but each time i
try to search when the database is empty i get this exception

Execution exception
IllegalStateException occured : Please re-index, not all indexed items
are available in the database

In {module:elasticsearch-0.4}/app/controllers/elasticsearch/
ElasticSearchController.java (around line 367)

363:
// FIXME Currently we ignore the orderBy and order fields
364:
query.from((page - 1) * getPageSize()).size(getPageSize());
365:
query.hydrate(true);
366:

367:
return query.fetch(); //here is the highlighted error
368:

369:
}
370:

371:
/**
372:
* Find by id.
373:
*
This exception has been logged with id 6a721jbki