# Deprecated API

## Contents

- Deprecated Interfaces
- Deprecated Classes
- Deprecated Enums
- Deprecated Fields
- Deprecated Methods
- Deprecated Constructors

- Deprecated Interfaces
  Interface and Description
  org.apache.lucene.search.FilterCache Use `QueryCache` instead
  org.apache.lucene.search.FilterCachingPolicy Use `QueryCachingPolicy` instead

- Deprecated Classes
  Class and Description
  org.apache.lucene.search.BitsFilteredDocIdSet This class is not useful internally anymore and will be removed in 6.0
  org.apache.lucene.search.CachingWrapperFilter Use `CachingWrapperQuery` and `BooleanClause.Occur.FILTER` clauses instead
  org.apache.lucene.search.CachingWrapperQuery Use a `QueryCache` instead, such as `LRUQueryCache`.
  org.apache.lucene.search.similarities.DefaultSimilarity Use `ClassicSimilarity` for equivilent behavior, or consider switching to `BM25Similarity` which will become the new default in Lucene 6.0
  org.apache.lucene.index.DocsAndPositionsEnum Use `PostingsEnum` instead.
  org.apache.lucene.index.DocsEnum Use `PostingsEnum` instead.
  org.apache.lucene.search.DocTermOrdsRewriteMethod Use `DocValuesRewriteMethod` instead.
  org.apache.lucene.search.FieldValueFilter Use `FieldValueQuery` instead
  org.apache.lucene.search.Filter Use `Query` objects instead: when queries are wrapped in a `ConstantScoreQuery` or in a `BooleanClause.Occur.FILTER` clause, they automatically disable the score computation so the `Filter` class does not provide benefits compared to queries anymore.
  org.apache.lucene.search.FilteredDocIdSet This class is not useful internally anymore and will be removed in 6.0
  org.apache.lucene.search.FilteredQuery FilteredQuery will be removed in Lucene 6.0. It should be replaced with a `BooleanQuery` with one `BooleanClause.Occur.MUST` clause for the query and one `BooleanClause.Occur.FILTER` clause for the filter.
  org.apache.lucene.search.LRUFilterCache Use `LRUQueryCache` instead
  org.apache.lucene.search.MultiTermQueryWrapperFilter Use `MultiTermQueryConstantScoreWrapper` instead
  org.apache.lucene.search.NumericRangeFilter Use `NumericRangeQuery` and `BooleanClause.Occur.FILTER` clauses instead.
  org.apache.lucene.search.PrefixFilter Use `PrefixQuery` and `BooleanClause.Occur.FILTER` clauses instead.
  org.apache.lucene.search.QueryWrapperFilter You can use `Query` objects directly for filtering by using `BooleanClause.Occur.FILTER` clauses in a `BooleanQuery`.
  org.apache.lucene.search.TermRangeFilter Use `TermRangeQuery` and `BooleanClause.Occur.FILTER` clauses instead.
  org.apache.lucene.analysis.Token This class is outdated and no longer used since Lucene 2.9. Nuke it finally!

- Deprecated Enums
  Enum and Description
  org.apache.lucene.document.Field.Index This is here only to ease transition from the pre-4.0 APIs.
  org.apache.lucene.document.Field.TermVector This is here only to ease transition from the pre-4.0 APIs.

- Deprecated Fields
  Field and Description
  org.apache.lucene.util.IOUtils.CHARSET_UTF_8 Use `StandardCharsets.UTF_8` instead.
  org.apache.lucene.search.MultiTermQuery.CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE old name of `MultiTermQuery.CONSTANT_SCORE_BOOLEAN_REWRITE`
  org.apache.lucene.search.MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE old name of `MultiTermQuery.CONSTANT_SCORE_REWRITE`
  org.apache.lucene.search.FuzzyQuery.defaultMinSimilarity pass integer edit distances instead.
  org.apache.lucene.util.Version.LUCENE_4_0 Bad naming of constant; use `Version.LUCENE_4_0_0` instead (this constant actually points to `Version.LUCENE_4_0_0_ALPHA` to match whole 4.0 series).
  org.apache.lucene.util.Version.LUCENE_4_0_0 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_0_0_ALPHA (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_0_0_BETA (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_1 Bad naming of constant; use `Version.LUCENE_4_1_0` instead.
  org.apache.lucene.util.Version.LUCENE_4_1_0 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_10_0 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_10_1 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_10_2 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_10_3 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_10_4 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_2 Bad naming of constant; use `Version.LUCENE_4_2_0` instead.
  org.apache.lucene.util.Version.LUCENE_4_2_0 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_2_1 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_3 Bad naming of constant; use `Version.LUCENE_4_3_0` instead.
  org.apache.lucene.util.Version.LUCENE_4_3_0 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_3_1 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_4 Bad naming of constant; use `Version.LUCENE_4_4_0` instead.
  org.apache.lucene.util.Version.LUCENE_4_4_0 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_5 Bad naming of constant; use `Version.LUCENE_4_5_0` instead.
  org.apache.lucene.util.Version.LUCENE_4_5_0 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_5_1 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_6 Bad naming of constant; use `Version.LUCENE_4_6_0` instead.
  org.apache.lucene.util.Version.LUCENE_4_6_0 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_6_1 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_7 Bad naming of constant; use `Version.LUCENE_4_7_0` instead.
  org.apache.lucene.util.Version.LUCENE_4_7_0 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_7_1 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_7_2 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_8 Bad naming of constant; use `Version.LUCENE_4_8_0` instead.
  org.apache.lucene.util.Version.LUCENE_4_8_0 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_8_1 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_9 Bad naming of constant; use `Version.LUCENE_4_9_0` instead.
  org.apache.lucene.util.Version.LUCENE_4_9_0 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_4_9_1 (5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_5_0_0 (5.1.0) Use latest
  org.apache.lucene.util.Version.LUCENE_5_1_0 (5.2.0) Use latest
  org.apache.lucene.util.Version.LUCENE_5_2_0 (5.3.0) Use latest
  org.apache.lucene.util.Version.LUCENE_5_2_1 Use latest
  org.apache.lucene.util.Version.LUCENE_5_3_0 (5.4.0) Use latest
  org.apache.lucene.util.Version.LUCENE_5_3_1 Use latest
  org.apache.lucene.util.Version.LUCENE_5_3_2 Use latest
  org.apache.lucene.util.Version.LUCENE_5_4_0 (5.5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_5_4_1 Use latest
  org.apache.lucene.util.Version.LUCENE_5_5_0 (5.5.1) Use latest
  org.apache.lucene.util.Version.LUCENE_5_5_1 (5.5.2) Use latest
  org.apache.lucene.util.Version.LUCENE_5_5_2 (5.5.3) Use latest
  org.apache.lucene.util.Version.LUCENE_5_5_3 (5.5.4) Use latest
  org.apache.lucene.util.Version.LUCENE_5_5_4 (5.5.5) Use latest
  org.apache.lucene.util.Version.LUCENE_CURRENT Use `Version.LATEST`
  org.apache.lucene.util.Constants.LUCENE_MAIN_VERSION Use `Version.LATEST`
  org.apache.lucene.util.Constants.LUCENE_VERSION Use `Version.LATEST`
  org.apache.lucene.index.DocsAndPositionsEnum.OLD_NULL_SEMANTICS only for internal use.
  org.apache.lucene.search.MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE old name of `MultiTermQuery.SCORING_BOOLEAN_REWRITE`
  org.apache.lucene.index.IndexWriterConfig.WRITE_LOCK_TIMEOUT Use `SleepingLockWrapper` if you want sleeping.
  org.apache.lucene.index.LiveIndexWriterConfig.writeLockTimeout Use `SleepingLockWrapper` if you want sleeping.

- Deprecated Methods
  Method and Description
  org.apache.lucene.search.BooleanQuery.add(BooleanClause) Boolean queries should be created once with `BooleanQuery.Builder` and then considered immutable. See `BooleanQuery.Builder.add(org.apache.lucene.search.BooleanClause)`.
  org.apache.lucene.search.DisjunctionMaxQuery.add(Collection) Use `DisjunctionMaxQuery.DisjunctionMaxQuery(Collection, float)` instead and provide all clauses at construction time
  org.apache.lucene.search.DisjunctionMaxQuery.add(Query) Use `DisjunctionMaxQuery.DisjunctionMaxQuery(Collection, float)` instead and provide all clauses at construction time
  org.apache.lucene.search.BooleanQuery.add(Query, BooleanClause.Occur) Boolean queries should be created once with `BooleanQuery.Builder` and then considered immutable. See `BooleanQuery.Builder.add(org.apache.lucene.search.BooleanClause)`.
  org.apache.lucene.search.PhraseQuery.add(Term) Phrase queries should be created once with `PhraseQuery.Builder` and then considered immutable. See `PhraseQuery.Builder.add(Term)`.
  org.apache.lucene.search.PhraseQuery.add(Term, int) Phrase queries should be created once with `PhraseQuery.Builder` and then considered immutable. See `PhraseQuery.Builder.add(Term, int)`.
  org.apache.lucene.search.spans.SpanOrQuery.addClause(SpanQuery) All clauses should be provided at `construction-time`.
  org.apache.lucene.util.BitDocIdSet.Builder.and(DocIdSetIterator)
  org.apache.lucene.util.BitSet.and(DocIdSetIterator)
  org.apache.lucene.util.BitDocIdSet.Builder.andNot(DocIdSetIterator)
  org.apache.lucene.util.BitSet.andNot(DocIdSetIterator)
  org.apache.lucene.util.BitUtil.bitCount(byte) Use `Integer.bitCount(int)` instead.
  org.apache.lucene.util.BitUtil.bitList(byte) do not use.
  org.apache.lucene.util.ToStringUtils.boost(float) per-query boosts are deprecated in favour of `BoostQuery`
  org.apache.lucene.codecs.CodecUtil.checkEOF(IndexInput) Use `CodecUtil.checkFooter(org.apache.lucene.store.ChecksumIndexInput)` instead, this should only used for files without checksums
  org.apache.lucene.search.Query.clone() Cloning was only useful for modifying boosts. Now that `Query.setBoost(float)` is deprecated, queries should be considered immutable.
  org.apache.lucene.index.TermsEnum.docs(Bits, DocsEnum) Use `TermsEnum.postings(PostingsEnum)` instead
  org.apache.lucene.index.TermsEnum.docs(Bits, DocsEnum, int) Use `TermsEnum.postings(PostingsEnum, int)` instead
  org.apache.lucene.index.TermsEnum.docsAndPositions(Bits, DocsAndPositionsEnum) Use `TermsEnum.postings(PostingsEnum, int)` instead
  org.apache.lucene.index.TermsEnum.docsAndPositions(Bits, DocsAndPositionsEnum, int) Use `TermsEnum.postings(PostingsEnum, int)` instead
  org.apache.lucene.index.SegmentInfos.files(Directory, boolean) Use `SegmentInfos.files(boolean)` instead.
  org.apache.lucene.search.FuzzyQuery.floatToEdits(float, int) pass integer edit distances instead.
  org.apache.lucene.search.Query.getBoost() Use `BoostQuery` instead to apply boosts.
  org.apache.lucene.search.BooleanQuery.getClauses() Use `BooleanQuery.clauses()`.
  org.apache.lucene.util.CharsRef.getUTF16SortedAsUTF8Comparator() This comparator is only a transition mechanism
  org.apache.lucene.util.BytesRef.getUTF8SortedAsUTF16Comparator() This comparator is only a transition mechanism
  org.apache.lucene.index.LiveIndexWriterConfig.getWriteLockTimeout() Use `SleepingLockWrapper` if you want sleeping.
  org.apache.lucene.util.NumericUtils.intToPrefixCodedBytes(int, int, BytesRefBuilder) Use `NumericUtils.intToPrefixCoded(int, int, org.apache.lucene.util.BytesRefBuilder)` instead.
  org.apache.lucene.index.IndexWriter.isLocked(Directory) Use of this method can only lead to race conditions. Try to actually obtain a lock instead.
  org.apache.lucene.util.NumericUtils.longToPrefixCodedBytes(long, int, BytesRefBuilder) Use `NumericUtils.longToPrefixCoded(long, int, org.apache.lucene.util.BytesRefBuilder)` instead.
  org.apache.lucene.store.DataInput.readStringSet() Only for reading existing formats. Encode maps with `DataOutput.writeSetOfStrings(Set)` instead.
  org.apache.lucene.store.DataInput.readStringStringMap() Only for reading existing formats. Encode maps with `DataOutput.writeMapOfStrings(Map)` instead.
  org.apache.lucene.search.IndexSearcher.search(Query, Filter, Collector) Use `boolean queries` with `BooleanClause.Occur.FILTER` clauses instead
  org.apache.lucene.search.IndexSearcher.search(Query, Filter, int) Use `boolean queries` with `BooleanClause.Occur.FILTER` clauses instead
  org.apache.lucene.search.IndexSearcher.search(Query, Filter, int, Sort) Use `boolean queries` with `BooleanClause.Occur.FILTER` clauses instead
  org.apache.lucene.search.IndexSearcher.search(Query, Filter, int, Sort, boolean, boolean) Use `boolean queries` with `BooleanClause.Occur.FILTER` clauses instead
  org.apache.lucene.search.IndexSearcher.searchAfter(ScoreDoc, Query, Filter, int) Use `boolean queries` with `BooleanClause.Occur.FILTER` clauses instead
  org.apache.lucene.search.IndexSearcher.searchAfter(ScoreDoc, Query, Filter, int, Sort) Use `boolean queries` with `BooleanClause.Occur.FILTER` clauses instead
  org.apache.lucene.search.IndexSearcher.searchAfter(ScoreDoc, Query, Filter, int, Sort, boolean, boolean) Use `boolean queries` with `BooleanClause.Occur.FILTER` clauses instead
  org.apache.lucene.search.Query.setBoost(float) Use `BoostQuery` instead to apply boosts.
  org.apache.lucene.index.SegmentCommitInfo.setGenUpdatesFiles(Map>) required to support 4.6-4.8 indexes.
  org.apache.lucene.search.BooleanQuery.setMinimumNumberShouldMatch(int) Boolean queries should be created once with `BooleanQuery.Builder` and then considered immutable. See `BooleanQuery.Builder.setMinimumNumberShouldMatch(int)`.
  org.apache.lucene.search.BooleanClause.setOccur(BooleanClause.Occur) BooleanClause will be immutable in 6.0.
  org.apache.lucene.search.BooleanClause.setQuery(Query) BooleanClause will be immutable in 6.0.
  org.apache.lucene.search.PhraseQuery.setSlop(int) Phrase queries should be created once with `PhraseQuery.Builder` and then considered immutable. See `PhraseQuery.Builder.setSlop(int)`.
  org.apache.lucene.index.IndexWriterConfig.setWriteLockTimeout(long) Use `SleepingLockWrapper` if you want sleeping.
  org.apache.lucene.index.LeafReader.termDocsEnum(Term) use `LeafReader.postings(Term)` instead
  org.apache.lucene.index.LeafReader.termPositionsEnum(Term) use `LeafReader.postings(Term, int)` instead
  org.apache.lucene.index.SegmentInfos.toString(Directory) Use `SegmentInfos.toString()` instead.
  org.apache.lucene.index.SegmentInfo.toString(Directory, int) Use `SegmentInfo.toString(int)` instead.
  org.apache.lucene.index.SegmentCommitInfo.toString(Directory, int) Use `SegmentCommitInfo.toString(int)` instead.
  org.apache.lucene.document.Field.translateFieldType(Field.Store, Field.Index, Field.TermVector) This is here only to ease transition from the pre-4.0 APIs.
  org.apache.lucene.search.IndexSearcher.wrapFilter(Query, Filter) Use `boolean queries` with `BooleanClause.Occur.FILTER` clauses instead
  org.apache.lucene.store.DataOutput.writeStringSet(Set) Use `DataOutput.writeMapOfStrings(Map)` instead.
  org.apache.lucene.store.DataOutput.writeStringStringMap(Map) Use `DataOutput.writeMapOfStrings(Map)` instead.

- Deprecated Constructors
  Constructor and Description
  org.apache.lucene.search.BooleanQuery() Use the `BooleanQuery.Builder` class to build boolean queries.
  org.apache.lucene.search.BooleanQuery(boolean) Use the `BooleanQuery.Builder` class to build boolean queries.
  org.apache.lucene.search.DisjunctionMaxQuery(float) Use `DisjunctionMaxQuery.DisjunctionMaxQuery(Collection, float)` instead
  org.apache.lucene.document.Field(String, byte[]) Use `StoredField` instead.
  org.apache.lucene.document.Field(String, byte[], int, int) Use `StoredField` instead.
  org.apache.lucene.document.Field(String, Reader) Use `TextField` instead.
  org.apache.lucene.document.Field(String, Reader, Field.TermVector) Use `TextField` instead.
  org.apache.lucene.document.Field(String, String, Field.Store, Field.Index) Use `StringField`, `TextField` instead.
  org.apache.lucene.document.Field(String, String, Field.Store, Field.Index, Field.TermVector) Use `StringField`, `TextField` instead.
  org.apache.lucene.document.Field(String, TokenStream) Use `TextField` instead
  org.apache.lucene.document.Field(String, TokenStream, Field.TermVector) Use `TextField` instead
  org.apache.lucene.search.PhraseQuery() Use the `PhraseQuery.Builder` class to build phrase queries.
  org.apache.lucene.search.spans.SpanNearQuery(SpanQuery[], int, boolean, boolean) Use `SpanNearQuery.SpanNearQuery(SpanQuery[], int, boolean)`

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.