# Deprecated API

## Contents

- For Removal
- Interfaces
- Classes
- Exceptions
- Fields
- Methods
- Constructors
- Enum Constants

- For Removal
  Element | Description
  --- | ---
  org.apache.lucene.analysis.StopwordAnalyzerBase.loadStopwordSet​(boolean, Class<? extends Analyzer>, String, String) | `Class.getResourceAsStream(String)` is caller sensitive and cannot load resources across Java Modules. Please call the `getResourceAsStream()` and `WordlistLoader.getWordSet(Reader, String, CharArraySet)` or other methods directly.
  org.apache.lucene.document.KeywordField.newSetQuery​(String, BytesRef...) | Use `KeywordField.newSetQuery(String, Collection)` instead.
  org.apache.lucene.document.SortedDocValuesField.newSlowSetQuery​(String, BytesRef...) | Use `SortedDocValuesField.newSlowSetQuery(String, Collection)` instead.
  org.apache.lucene.document.SortedSetDocValuesField.newSlowSetQuery​(String, BytesRef...) | Use `SortedSetDocValuesField.newSlowSetQuery(String, Collection)` instead.
  org.apache.lucene.store.MMapDirectory.setUseUnmap​(boolean) | Please use new system property `MMapDirectory.ENABLE_UNMAP_HACK_SYSPROP` instead
  org.apache.lucene.util.IOUtils.getDecodingReader​(Class<?>, String, Charset) | `Class.getResourceAsStream(String)` is caller sensitive and cannot load resources across Java Modules. Please call the `getResourceAsStream()` directly and use `IOUtils.requireResourceNonNull(Object,String)` to signal missing resources `null`
  org.apache.lucene.util.IOUtils.IOConsumer | was replaced by `IOConsumer`.
  org.apache.lucene.util.IOUtils.IOFunction | was replaced by `IOFunction`.

- Interfaces
  Interface | Description
  --- | ---
  org.apache.lucene.util.IOUtils.IOConsumer | was replaced by `IOConsumer`.
  org.apache.lucene.util.IOUtils.IOFunction | was replaced by `IOFunction`.

- Classes
  Class | Description
  --- | ---
  org.apache.lucene.document.KnnVectorField | use `KnnFloatVectorField` instead
  org.apache.lucene.index.VectorValues | use `FloatVectorValues` instead
  org.apache.lucene.search.DocValuesFieldExistsQuery | Use `FieldExistsQuery` instead.
  org.apache.lucene.search.KnnVectorFieldExistsQuery | Use `FieldExistsQuery` instead.
  org.apache.lucene.search.KnnVectorQuery | use `KnnFloatVectorQuery` instead
  org.apache.lucene.search.NormsFieldExistsQuery | Use `FieldExistsQuery` instead.
  org.apache.lucene.util.automaton.DaciukMihovAutomatonBuilder | Visibility of this class will be reduced in a future release. Users can access this functionality directly through `Automata.makeStringUnion(Iterable)`

- Exceptions
  Exceptions | Description
  --- | ---
  org.apache.lucene.search.BooleanQuery.TooManyClauses | use `IndexSearcher.TooManyClauses`

- Fields
  Field | Description
  --- | ---
  org.apache.lucene.index.SortedSetDocValues.NO_MORE_ORDS | Will be removed in a future version. Please use `SortedSetDocValues.docValueCount()` to know the number of doc values for the current document up-front.
  org.apache.lucene.util.automaton.DaciukMihovAutomatonBuilder.MAX_TERM_LENGTH | See `Automata.MAX_STRING_UNION_TERM_LENGTH`
  org.apache.lucene.util.BitUtil.VH_BE_DOUBLE | Better use little endian unless it is needed for backwards compatibility.
  org.apache.lucene.util.BitUtil.VH_BE_FLOAT | Better use little endian unless it is needed for backwards compatibility.
  org.apache.lucene.util.BitUtil.VH_BE_INT | Better use little endian unless it is needed for backwards compatibility.
  org.apache.lucene.util.BitUtil.VH_BE_LONG | Better use little endian unless it is needed for backwards compatibility.
  org.apache.lucene.util.BitUtil.VH_BE_SHORT | Better use little endian unless it is needed for backwards compatibility.
  org.apache.lucene.util.Constants.JAVA_VERSION | To detect Java versions use `Runtime.version()`
  org.apache.lucene.util.Constants.JRE_IS_MINIMUM_JAVA11 | This constant is useless and always `true`. To detect Java versions use `Runtime.version()`
  org.apache.lucene.util.Constants.JRE_IS_MINIMUM_JAVA8 | This constant is useless and always `true`. To detect Java versions use `Runtime.version()`
  org.apache.lucene.util.Constants.JRE_IS_MINIMUM_JAVA9 | This constant is useless and always `true`. To detect Java versions use `Runtime.version()`
  org.apache.lucene.util.Constants.JVM_SPEC_VERSION | To detect Java versions use `Runtime.version()`
  org.apache.lucene.util.Constants.JVM_VERSION | To detect Java versions use `Runtime.version()`
  org.apache.lucene.util.Version.LUCENE_8_0_0 | (9.0.0) Use latest
  org.apache.lucene.util.Version.LUCENE_8_1_0 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_1_1 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_10_0 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_10_1 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_11_0 | (8.11.1) Use latest
  org.apache.lucene.util.Version.LUCENE_8_11_1 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_11_2 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_11_3 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_12_0 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_2_0 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_3_0 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_3_1 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_4_0 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_4_1 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_5_0 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_5_1 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_5_2 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_6_0 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_6_1 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_6_2 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_6_3 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_7_0 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_8_0 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_8_1 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_8_2 | Use latest
  org.apache.lucene.util.Version.LUCENE_8_9_0 | Use latest
  org.apache.lucene.util.Version.LUCENE_9_0_0 | (9.1.0) Use latest
  org.apache.lucene.util.Version.LUCENE_9_1_0 | (9.2.0) Use latest
  org.apache.lucene.util.Version.LUCENE_9_2_0 | (9.3.0) Use latest
  org.apache.lucene.util.Version.LUCENE_9_3_0 | (9.4.0) Use latest
  org.apache.lucene.util.Version.LUCENE_9_4_0 | (9.5.0) Use latest
  org.apache.lucene.util.Version.LUCENE_9_4_1 | Use latest
  org.apache.lucene.util.Version.LUCENE_9_4_2 | Use latest
  org.apache.lucene.util.Version.LUCENE_9_5_0 | (9.6.0) Use latest
  org.apache.lucene.util.Version.LUCENE_9_6_0 | (9.7.0) Use latest
  org.apache.lucene.util.Version.LUCENE_9_7_0 | (9.8.0) Use latest
  org.apache.lucene.util.Version.LUCENE_9_8_0 | (9.9.0) Use latest
  org.apache.lucene.util.Version.LUCENE_9_9_0 | (9.9.1) Use latest
  org.apache.lucene.util.Version.LUCENE_9_9_1 | (9.9.2) Use latest
  org.apache.lucene.util.Version.LUCENE_9_9_2 | (9.10.0) Use latest
  org.apache.lucene.util.Version.LUCENE_CURRENT | Use `Version.LATEST`

- Methods
  Method | Description
  --- | ---
  org.apache.lucene.analysis.StopwordAnalyzerBase.loadStopwordSet​(boolean, Class<? extends Analyzer>, String, String) | `Class.getResourceAsStream(String)` is caller sensitive and cannot load resources across Java Modules. Please call the `getResourceAsStream()` and `WordlistLoader.getWordSet(Reader, String, CharArraySet)` or other methods directly.
  org.apache.lucene.document.KeywordField.newSetQuery​(String, BytesRef...) | Use `KeywordField.newSetQuery(String, Collection)` instead.
  org.apache.lucene.document.LongPoint.newDistanceFeatureQuery​(String, float, long, long) |
  org.apache.lucene.document.SortedDocValuesField.newSlowSetQuery​(String, BytesRef...) | Use `SortedDocValuesField.newSlowSetQuery(String, Collection)` instead.
  org.apache.lucene.document.SortedSetDocValuesField.newSlowSetQuery​(String, BytesRef...) | Use `SortedSetDocValuesField.newSlowSetQuery(String, Collection)` instead.
  org.apache.lucene.index.CodecReader.document​(int, StoredFieldVisitor) |
  org.apache.lucene.index.CodecReader.getTermVectors​(int) |
  org.apache.lucene.index.FilterCodecReader.document​(int, StoredFieldVisitor) |
  org.apache.lucene.index.FilterCodecReader.getTermVectors​(int) |
  org.apache.lucene.index.IndexReader.document​(int, StoredFieldVisitor) | use `IndexReader.storedFields()` to retrieve one or more documents
  org.apache.lucene.index.IndexReader.getTermVector​(int, String) | use `IndexReader.termVectors()` to retrieve one or more documents
  org.apache.lucene.index.IndexReader.getTermVectors​(int) | use `IndexReader.termVectors()` to retrieve one or more documents
  org.apache.lucene.search.BooleanQuery.getMaxClauseCount() | use `IndexSearcher.getMaxClauseCount()`
  org.apache.lucene.search.BooleanQuery.setMaxClauseCount​(int) | use `IndexSearcher.setMaxClauseCount(int)`
  org.apache.lucene.search.IndexSearcher.doc​(int) | Use `IndexSearcher.storedFields()` to access fields for one or more documents
  org.apache.lucene.search.IndexSearcher.getExecutor() | use `IndexSearcher.getTaskExecutor()` executor instead to execute concurrent tasks
  org.apache.lucene.search.IndexSearcher.search​(Query, Collector) | This method is being deprecated in favor of `IndexSearcher.search(Query, CollectorManager)` due to its support for concurrency in IndexSearcher
  org.apache.lucene.search.MultiTermQuery.setRewriteMethod​(MultiTermQuery.RewriteMethod) | set this using a constructor instead
  org.apache.lucene.search.Query.rewrite​(IndexReader) | Use `Query.rewrite(IndexSearcher)`
  org.apache.lucene.search.SortField.getOptimizeSortWithIndexedData() |
  org.apache.lucene.search.SortField.getOptimizeSortWithPoints() | This is a duplicate method for `SortField#getOptimizeSortWithIndexedData`.
  org.apache.lucene.search.SortField.setOptimizeSortWithIndexedData​(boolean) | should only be used for compatibility with 8.x indices that got created with inconsistent data across fields, or the wrong sort configuration in the index sort
  org.apache.lucene.search.SortField.setOptimizeSortWithPoints​(boolean) | should only be used for compatibility with 8.x indices that got created with inconsistent data across fields, or the wrong sort configuration in the index sort. This is a duplicate method for `SortField#setOptimizeSortWithIndexedData`.
  org.apache.lucene.search.TermInSetQuery.getTermData() | the encoded terms will no longer be exposed in a future major version; this is an implementation detail that could change at some point and shouldn't be relied on directly
  org.apache.lucene.search.TopFieldCollector.create​(Sort, int, int) | This method is deprecated in favor of the constructor of `TopFieldCollectorManager` due to its support for concurrency in IndexSearcher
  org.apache.lucene.search.TopFieldCollector.createSharedManager​(Sort, int, FieldDoc, int) | This method is deprecated in favor of the constructor of `TopFieldCollectorManager` due to its support for concurrency in IndexSearcher
  org.apache.lucene.search.TopScoreDocCollector.create​(int, int) | This method is deprecated in favor of the constructor of `TopScoreDocCollectorManager` due to its support for concurrency in IndexSearcher
  org.apache.lucene.search.TopScoreDocCollector.createSharedManager​(int, ScoreDoc, int) | This method is deprecated in favor of the constructor of `TopScoreDocCollectorManager` due to its support for concurrency in IndexSearcher
  org.apache.lucene.store.ByteBuffersDataInput.size() | Use `ByteBuffersDataInput.length()` instead.
  org.apache.lucene.store.MMapDirectory.getPreload() | This information is no longer reliable now that preloading is more granularly configured via a predicate.
  org.apache.lucene.store.MMapDirectory.getUseUnmap() | use `MMapDirectory.UNMAP_SUPPORTED`
  org.apache.lucene.store.MMapDirectory.setPreload​(boolean) | Use `MMapDirectory.setPreload(BiPredicate)` instead which provides more granular control.
  org.apache.lucene.store.MMapDirectory.setUseUnmap​(boolean) | Please use new system property `MMapDirectory.ENABLE_UNMAP_HACK_SYSPROP` instead
  org.apache.lucene.util.automaton.DaciukMihovAutomatonBuilder.build​(Iterable<BytesRef>) | Please see `Automata.makeStringUnion(Iterable)` instead
  org.apache.lucene.util.CharsRef.getUTF16SortedAsUTF8Comparator() | This comparator is only a transition mechanism
  org.apache.lucene.util.IOUtils.getDecodingReader​(Class<?>, String, Charset) | `Class.getResourceAsStream(String)` is caller sensitive and cannot load resources across Java Modules. Please call the `getResourceAsStream()` directly and use `IOUtils.requireResourceNonNull(Object,String)` to signal missing resources `null`

- Constructors
  Constructor | Description
  --- | ---
  org.apache.lucene.document.DoubleField​(String, double) | Use `DoubleField(String, double, Field.Store)` with `Field.Store.NO` instead.
  org.apache.lucene.document.FloatField​(String, float) | Use `FloatField(String, float, Field.Store)` with `Field.Store.NO` instead.
  org.apache.lucene.document.IntField​(String, int) | Use `IntField(String, int, Field.Store)` with `Field.Store.NO` instead.
  org.apache.lucene.document.LongField​(String, long) | Use `LongField(String, long, Field.Store)` with `Field.Store.NO` instead.
  org.apache.lucene.search.TermInSetQuery​(String, BytesRef...) | Use `TermInSetQuery(String, Collection)` instead.
  org.apache.lucene.store.MMapDirectory​(Path, int) | use `MMapDirectory(Path, long)` instead.

- Enum Constants
  Enum Constant | Description
  --- | ---
  org.apache.lucene.util.packed.PackedInts.Format.PACKED_SINGLE_BLOCK | Use `PackedInts.Format.PACKED` instead.