# Apache Lucene Migration Guide ## Separation of IndexDocument and StoredDocument (LUCENE-3312) The API of oal.document was restructured to differentiate between stored documents and indexed documents. IndexReader.document(int) now returns StoredDocument instead of Document. In most cases a simple replacement of the return type is enough to upgrade. ## FunctionValues.exist() Behavior Changes due to ValueSource bug fixes (LUCENE-5961) Bugs fixed in several ValueSource functions may result in different behavior in situations where some documents do not have values for fields wrapped in other ValueSources. Users who want to preserve the previous behavior may need to wrap their ValueSources in a "DefFunction" along with a ConstValueSource of "0.0".