由于项目需求,需要将Lucene4.6升级到Lucene6.6,因此我对这之间的所有重要的API改动做了搜集;特别重要的改变加粗显示。
Lucene4.7改动:
LUCENE-5405: Make ShingleAnalzyerWrapper.getWrappedAnalyzer() public final
(gsingers)
LUCENE-5395: TheSpatialArgsParser now only reads WKT, no more "lat, lon" etc. butit's easy to override the parseShape method if you wish.
Lucene4.8改动:
-
LUCENE-5516: MergeScheduler#merge()now accepts a MergeTrigger as well as a boolean that indicates if a new mergewas found in the caller thread before the scheduler was called.
(Simon Willnauer) -
LUCENE-5487: Separated bulk scorer (new Weight.bulkScorer method)from normal scoring (Weight.scorer) for those queries that can do bulk scoringmore efficiently, e.g. BooleanQuery in some cases. This also simplified theWeight.scorer API by removing the two confusing booleans.
Lucene4.9改动:
- ·LUCENE-5725:MoreLikeThis#like now accepts multiple values per field. The pre-existingmethod has been deprecated in favor of a variable arguments for the like text.
(Alex Ksikes via Simon Willnauer) - ·LUCENE-5711: MergePolicyaccepts an IndexWriter instance on each method rather than holding stateagainst a single IndexWriter instance.
- ·LUCENE-5640:The Token class was deprecated. Since Lucene 2.9, TokenStreams are usingAttributes, Token is no longer used.
(Uwe Schindler, Robert Muir) - ·LUCENE-5678:IndexOutput no longer allows seeking, so it is no longer required to useRandomAccessFile to write Indexes. Lucene now uses standard FileOutputStreamwrapped with OutputStreamIndexOutput to write index data. BufferedIndexOutputwas removed, because buffering and checksumming is provided byFilterOutputStreams, provided by the JDK.
Lucene5.0改动:
LUCENE-4924: DocIdSetIterator.docID() must now return -1 when the iterator is notpositioned. This change affects all classes that inherit from DocIdSetIterator,including DocsEnum and DocsAndPositionsEnum.
(Adrien Grand)
LUCENE-5388: Remove Reader fromTokenizer's constructor and from Analyzer's createComponents. TokenStreams nowalways get their input via setReader.
(Benson Margulies via Robert Muir - pull request #16)
LUCENE-5527: The Collector API has been refactored to use adedicated(专用的) Collector per leaf.
(Shikhar Bhushan, Adrien Grand)
LUCENE-5702: The FieldComparator API has been refactor to aper-leaf API, just like Collectors.
(Adrien Grand)
LUCENE-4246: IndexWriter.close now always closes, even if itthrows an exception. The new IndexWriterConfig.setCommitOnClose (default true)determines whether close() should commit before closing.
LUCENE-5569: *AtomicReader/AtomicReaderContext have been renamed to *LeafReader/LeafReaderContext.
LUCENE-6021:FixedBitSet.nextSetBitnow returns DocIdSetIterator.NO_MORE_DOCS instead of -1 when there are no morebits which are set.
(Adrien Grand)
LUCENE-6084: IndexOutput'sconstructor now requires a String resourceDescription so its toString is sane
(Robert Muir, Mike McCandless)
LUCENE-6121:CachingTokenFilter.reset() now propagates to its input if called beforeincrementToken(). You must call reset() now on this filter instead of doing ita-priori on the input(), which previously didn't work.
(David Smiley, Robert Muir)
LUCENE-6165: IndexWriter.addIndexes(IndexReader...) changed toaddIndexes(CodecReader...)
(Robert Muir)
Lucene5.1改动:
LUCENE-6218, LUCENE-6220: AddCollector.needsScores() and needsScores parameter to Query.createWeight().
(Robert Muir, Adrien Grand)
LUCENE-4524, LUCENE-6246, LUCENE-6256, LUCENE-6271:
MergeDocsEnum and DocsAndPositionsEnum into a single PostingsEnum iterator.TermsEnum.docs() and TermsEnum.docsAndPositions() are replaced byTermsEnum.postings().
LUCENE-6270:Replaced TermsFilter with TermsQuery, use a QueryWrapperFilter(TermsQuery)instead.
(Adrien Grand)
LUCENE-6272: Scorerextends DocSetIdIterator rather than DocsEnum
(Alan Woodward)
LUCENE-6286: Removed IndexSearcher methods that take aFilter object. A BooleanQuery with a filter clause must be used instead.
(Adrien Grand)
LUCENE-6300:PrefixFilter, TermRangeFilter and NumericRangeFilter have been removed. UsePrefixQuery, TermRangeQuery and NumericRangeQuery instead.
(Adrien Grand)
LUCENE-6303:Replaced FilterCache with QueryCache and CachingWrapperFilter withCachingWrapperQuery.
(Adrien Grand)
Lucene5.2改动:
-
LUCENE-6377:SearcherFactory#newSearcher now accepts the previous reader to simplify warminglogic during opening new searchers.
(Simon Willnauer) -
LUCENE-6410:Removed unused "reuse" parameter to Terms.iterator.
(Robert Muir, Mike McCandless)
Lucene5.3改动:
-
LUCENE-6552:Add MergePolicy.OneMerge.getMergeInfo and rename setInfo to setMergeInfo
(Simon Willnauer, Mike McCandless) -
LUCENE-6583:FilteredQuery is deprecated and will be removed in 6.0. It should be replacedwith a BooleanQuery which handle thequery as a MUST clause and the filter as a FILTER clause.
(Adrien Grand) -
LUCENE-6553: The postings, spans and scorer APIs nolonger take an acceptDocs parameter. Live docs are now always checked on top ofthese APIs.
(Adrien Grand) -
LUCENE-6643:GroupingSearch from lucene/grouping was changed to take a Query object todefine groups instead of a Filter.
(Adrien Grand) -
LUCENE-6648:All lucene/facet APIs now take Queryobjects where they used to take Filter objects.
(Adrien Grand) -
LUCENE-6531:PhraseQuery is now immutable and can be built using the PhraseQuery.Builderclass.
(Adrien Grand) -
LUCENE-6570:BooleanQuery is now immutable and can bebuilt using the BooleanQuery.Builder class.
(Adrien Grand)
Lucene5.4改动:
-
LUCENE-6855:CachingWrapperQuery is deprecated and will be removed in 6.0.
(Adrien Grand) -
LUCENE-6849:Expose IndexWriter.flush() method, to move all in-memory segments to diskwithout opening a near-real-time reader nor calling fsync
(Robert Muir, Simon Willnauer, Mike McCandless)
Lucene5.5改动:
-
LUCENE-6919:The Scorer class has been refactored toexpose an iterator instead of extending DocIdSetIterator. asTwoPhaseIterator()has been renamed to twoPhaseIterator() for consistency.
(Adrien Grand) -
LUCENE-6980:Default applyAllDeletes to true when opening near-real-time readers
(Mike McCandless) -
LUCENE-6932:IndexInput.seek implementations now throw EOFException if you seek beyond theend of the file
(Adrien Grand, Mike McCandless) -
LUCENE-6988:IndexableField.tokenStream() no longer throws IOException
(Alan Woodward)
Lucene6.0改动:
LUCENE-6583:FilteredQuery has been removed. Instead, you can construct a BooleanQuery withone MUST clause for the query, and one FILTER clause for the filter.
(Adrien Grand)
LUCENE-6706:PayloadTermQuery and PayloadNearQuery have been removed. Instead, usePayloadScoreQuery to wrap any SpanQuery.
(Alan Woodward)
LUCENE-6947:SortField.missingValue is now protected. You can read its value using the newSortField.getMissingValue getter.
(Adrien Grand)
LUCENE-7052, LUCENE-7053: Removecustom comparators from BytesRef class and solely use natural byte[] comparatorthroughout codebase. This also simplifies API of BytesRefHash. It also replacesthe natural comparator in ArrayUtil by Java 8's Comparator#naturalOrder().
(Mike McCandless, Uwe Schindler, Robert Muir)
LUCENE-7058: Addgetters to various Query implementations
(Guillaume Smet via AlanWoodward)
LUCENE-7064:MultiPhraseQuery is now immutable and should be constructed withMultiPhraseQuery.Builder.
(Luc Vanlerberghe via Adrien Grand)
LUCENE-6952: Theseclasses are now abstract: FilterCodecReader, FilterLeafReader, FilterCollector,FilterDirectory. And some Filter* classes in lucene-test-framework too.
(David Smiley)
SOLR-8867:FunctionValues.getRangeScorer now takes a LeafReaderContext instead of anIndexReader, and avoids matching documents without a value in the field fornumeric fields.
(yonik)
Lucene6.1改动:
LUCENE-7243:Removedthe LeafReaderContext parameter from QueryCachingPolicy#shouldCache.
(Adrien Grand)
Lucene6.2改动:
ScoringWrapperSpans was removed since ithad no purpose or effect as of Lucene 5.5.
Lucene6.3改动:
修复了一些BUG无API改动!
Lucene6.4改动:
修复了一些BUG无API改动!
Lucene6.5改动:
-
· LUCENE-7624:TermsQuery has been renamed as TermInSetQuery and moved to core.
(Alan Woodward) -
LUCENE-7637:TermInSetQuery requires that all terms come from the same field.
(Adrien Grand) -
LUCENE-7644:FieldComparatorSource.newComparator() and SortField.getComparator() no longerthrow IOException
(Alan Woodward) -
LUCENE-7628:Scorer.getChildren() now only returns Scorers that are positioned on thecurrent document, and can throw an IOException. AssertingScorer checks thatgetChildren() is not called on an unpositioned Scorer.
(Alan Woodward, Adrien Grand) -
LUCENE-7707:TopDocs.merge now takes a boolean option telling it when to use the incomingshard index versus when to assign the shard index itself, allowing users tomerge shard responses incrementally instead of once all shard responses arepresent.
(Simon Willnauer, Mike McCandless)
Lucene6.6改动:
修复了一些BUG无API改动!