# Error in elastic search

**URL:** <https://discuss.elastic.co/t/error-in-elastic-search/7777>\
**Category:** Elasticsearch\
**Created:** [May 20, 2012, 10:03am UTC](https://discuss.elastic.co/t/error-in-elastic-search/7777 "2012-05-20T10:03:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Renad\_Ahmed](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@Renad\_Ahmed](https://discuss.elastic.co/u/Renad_Ahmed)\
**Post date:** [May 20, 2012, 10:03am UTC](https://discuss.elastic.co/t/error-in-elastic-search/7777/1 "2012-05-20T10:03:45Z")

</div>

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 366)

362:  
Query query = (Query) ElasticSearch.query(qb, entityClass);  
363:  
// FIXME Currently we ignore the orderBy and order fields  
364:  
query.from((page - 1) \* getPageSize()).size(getPageSize());  
365:  
query.hydrate(true);  
366:  
return query.fetch();  
367:

368:

369:  
}  
370:

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

Elastic search was working perfectly suddenly it gave me this error  
for no reason without me changing the code. the highlighted part is  
return query.fetch();

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 20, 2012, 10:02pm UTC](https://discuss.elastic.co/t/error-in-elastic-search/7777/2 "2012-05-20T22:02:29Z")

</div>

It seems like a message you get from your app, elasticsearch does not  
generate this failure.

On Sun, May 20, 2012 at 12:03 PM, Renad [renad.ahmed23@gmail.com](mailto:renad.ahmed23@gmail.com) wrote:

> 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 366)
> 
> 362:  
> Query query = (Query) Elasticsearch.query(qb,  
> entityClass);  
> 363:  
> // FIXME Currently we ignore the orderBy and order  
> fields  
> 364:  
> query.from((page - 1) \*  
> getPageSize()).size(getPageSize());  
> 365:  
> query.hydrate(true);  
> 366:  
> return query.fetch();  
> 367:
> 
> 368:
> 
> 369:  
> }  
> 370:
> 
> 371:  
> /\*\*  
> 372:  
> \* Find by id.  
> This exception has been logged with id 6adhkiajc
> 
> Elastic search was working perfectly suddenly it gave me this error  
> for no reason without me changing the code. the highlighted part is  
> return query.fetch();

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:27am UTC](https://discuss.elastic.co/t/error-in-elastic-search/7777/3 "2017-07-06T03:27:57Z")

</div>


