Programming : Migration from Lucene 1.4 to 1.9

This page last changed on Mar 24, 2006 by Kees de Kooter

Here are the issues I encountered migrating from Lucene 1.4 to 1.9. Lucene 1.9 is fully backward compatible, but a lot of methods are deprecated and will be removed in the 2.0 release. All deprecations make sense, resultiung in a cleaner and more verbose api. All deprecations are documented properly, with recommended new ways of coding. But still migrating can take some time.

Field types

The field definition has become a bit more verbose. The static constructors are deprecated. Instead you have to use contructors in which the index and storage aspects are separated.

old api

new api - Store

new api - Index

Field.Keyword

Field.Store.YES

Field.Index.UN_TOKENIZED

Field.UnIndexed

Field.Store.YES

Field.Index.NO

Field.UnStored

Field.Store.NO

Field.Index.TOKENIZED

Field.Text

Field.Store.YES

Field.Index.TOKENIZED