博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Lucene4.6至 Lucene6.6的每个迭代对API的改动
阅读量:5064 次
发布时间:2019-06-12

本文共 8228 字,大约阅读时间需要 27 分钟。

由于项目需求,需要将Lucene4.6升级到Lucene6.6,因此我对这之间的所有重要的API改动做了搜集;特别重要的改变加粗显示。

 

Lucene4.7改动:

: Make ShingleAnalzyerWrapper.getWrappedAnalyzer() public final

(gsingers)

: The SpatialArgsParser now only reads WKT, no more "lat, lon" etc. but it's easy to override the parseShape method if you wish.

Lucene4.8改动:

  • : MergeScheduler#merge() now accepts a MergeTrigger as well as a boolean that indicates if a new merge was found in the caller thread before the scheduler was called.
    (Simon Willnauer)
  • : Separated bulk scorer (new Weight.bulkScorer method) from normal scoring (Weight.scorer) for those queries that can do bulk scoring more efficiently, e.g. BooleanQuery in some cases. This also simplified the Weight.scorer API by removing the two confusing booleans.

 

Lucene4.9改动:

  • ·: MoreLikeThis#like now accepts multiple values per field. The pre-existing method has been deprecated in favor of a variable arguments for the like text.
    (Alex Ksikes via Simon Willnauer)
  • ·: MergePolicy accepts an IndexWriter instance on each method rather than holding state against a single IndexWriter instance.
  • ·: The Token class was deprecated. Since Lucene 2.9, TokenStreams are using Attributes, Token is no longer used.
    (Uwe Schindler, Robert Muir)
  • ·: IndexOutput no longer allows seeking, so it is no longer required to use RandomAccessFile to write Indexes. Lucene now uses standard FileOutputStream wrapped with OutputStreamIndexOutput to write index data. BufferedIndexOutput was removed, because buffering and checksumming is provided by FilterOutputStreams, provided by the JDK.

 

 

Lucene5.0改动:

: DocIdSetIterator.docID() must now return -1 when the iterator is not positioned. This change affects all classes that inherit from DocIdSetIterator, including DocsEnum and DocsAndPositionsEnum.

(Adrien Grand)

: Remove Reader from Tokenizer's constructor and from Analyzer's createComponents. TokenStreams now always get their input via setReader.

(Benson Margulies via Robert Muir - )

: The Collector API has been refactored to use a dedicated(专用的) Collector per leaf.

(Shikhar Bhushan, Adrien Grand)

: The FieldComparator API has been refactor to a per-leaf API, just like Collectors.

(Adrien Grand)

: IndexWriter.close now always closes, even if it throws an exception. The new IndexWriterConfig.setCommitOnClose (default true) determines whether close() should commit before closing.

: *AtomicReader/AtomicReaderContext have been renamed to *LeafReader/LeafReaderContext.

:FixedBitSet.nextSetBit now returns DocIdSetIterator.NO_MORE_DOCS instead of -1 when there are no more bits which are set.

(Adrien Grand)

: IndexOutput's constructor now requires a String resourceDescription so its toString is sane

(Robert Muir, Mike McCandless)

: CachingTokenFilter.reset() now propagates to its input if called before incrementToken(). You must call reset() now on this filter instead of doing it a-priori on the input(), which previously didn't work.

(David Smiley, Robert Muir)

: IndexWriter.addIndexes(IndexReader...) changed to addIndexes(CodecReader...)

(Robert Muir)

 

 

Lucene5.1改动:

, : Add Collector.needsScores() and needsScores parameter to Query.createWeight().

(Robert Muir, Adrien Grand)

, , , :

Merge DocsEnum and DocsAndPositionsEnum into a single PostingsEnum iterator. TermsEnum.docs() and TermsEnum.docsAndPositions() are replaced by TermsEnum.postings().

: Replaced TermsFilter with TermsQuery, use a QueryWrapperFilter(TermsQuery) instead.

(Adrien Grand)

: Scorer extends DocSetIdIterator rather than DocsEnum

(Alan Woodward)

: Removed IndexSearcher methods that take a Filter object. A BooleanQuery with a filter clause must be used instead.

(Adrien Grand)

: PrefixFilter, TermRangeFilter and NumericRangeFilter have been removed. Use PrefixQuery, TermRangeQuery and NumericRangeQuery instead.

(Adrien Grand)

: Replaced FilterCache with QueryCache and CachingWrapperFilter with CachingWrapperQuery.

(Adrien Grand)

 

 

Lucene5.2改动:

  • : SearcherFactory#newSearcher now accepts the previous reader to simplify warming logic during opening new searchers.
    (Simon Willnauer)
  • : Removed unused "reuse" parameter to Terms.iterator.
    (Robert Muir, Mike McCandless)

 

Lucene5.3改动:

  • : Add MergePolicy.OneMerge.getMergeInfo and rename setInfo to setMergeInfo
    (Simon Willnauer, Mike McCandless)
  • : FilteredQuery is deprecated and will be removed in 6.0. It should be replaced with a BooleanQuery which handle the query as a MUST clause and the filter as a FILTER clause.
    (Adrien Grand)
  • : The postings, spans and scorer APIs no longer take an acceptDocs parameter. Live docs are now always checked on top of these APIs.
    (Adrien Grand)
  • : GroupingSearch from lucene/grouping was changed to take a Query object to define groups instead of a Filter.
    (Adrien Grand)
  • : All lucene/facet APIs now take Query objects where they used to take Filter objects.
    (Adrien Grand)  
  • : PhraseQuery is now immutable and can be built using the PhraseQuery.Builder class.
    (Adrien Grand)
  • : BooleanQuery is now immutable and can be built using the BooleanQuery.Builder class.
    (Adrien Grand)

 

Lucene5.4改动:

  • : CachingWrapperQuery is deprecated and will be removed in 6.0.
    (Adrien Grand)
  • : Expose IndexWriter.flush() method, to move all in-memory segments to disk without opening a near-real-time reader nor calling fsync
    (Robert Muir, Simon Willnauer, Mike McCandless)

 

Lucene5.5改动:

  • : The Scorer class has been refactored to expose an iterator instead of extending DocIdSetIterator. asTwoPhaseIterator() has been renamed to twoPhaseIterator() for consistency.
    (Adrien Grand)
  • : Default applyAllDeletes to true when opening near-real-time readers
    (Mike McCandless)
  • : IndexInput.seek implementations now throw EOFException if you seek beyond the end of the file
    (Adrien Grand, Mike McCandless)
  • : IndexableField.tokenStream() no longer throws IOException
    (Alan Woodward)

 

Lucene6.0改动:

: FilteredQuery has been removed. Instead, you can construct a BooleanQuery with one MUST clause for the query, and one FILTER clause for the filter.

(Adrien Grand)

: PayloadTermQuery and PayloadNearQuery have been removed. Instead, use PayloadScoreQuery to wrap any SpanQuery.

(Alan Woodward)

: SortField.missingValue is now protected. You can read its value using the new SortField.getMissingValue getter.

(Adrien Grand)

, : Remove custom comparators from BytesRef class and solely use natural byte[] comparator throughout codebase. This also simplifies API of BytesRefHash. It also replaces the natural comparator in ArrayUtil by Java 8's Comparator#naturalOrder().

(Mike McCandless, Uwe Schindler, Robert Muir)

: Add getters to various Query implementations

(Guillaume Smet via Alan Woodward)

: MultiPhraseQuery is now immutable and should be constructed with MultiPhraseQuery.Builder.

(Luc Vanlerberghe via Adrien Grand)

: These classes are now abstract: FilterCodecReader, FilterLeafReader, FilterCollector, FilterDirectory. And some Filter* classes in lucene-test-framework too.

(David Smiley)

: FunctionValues.getRangeScorer now takes a LeafReaderContext instead of an IndexReader, and avoids matching documents without a value in the field for numeric fields.

(yonik)

 

 

Lucene6.1改动:

:Removed the LeafReaderContext parameter from QueryCachingPolicy#shouldCache.

(Adrien Grand)

 

 

Lucene6.2改动:

ScoringWrapperSpans was removed since it had no purpose or effect as of Lucene 5.5.

 

Lucene6.3改动:

修复了一些BUG无API改动!

 

Lucene6.4改动:

修复了一些BUG无API改动!

 

Lucene6.5改动:

  • ·  : TermsQuery has been renamed as TermInSetQuery and moved to core.
    (Alan Woodward)
  • : TermInSetQuery requires that all terms come from the same field.
    (Adrien Grand)
  • : FieldComparatorSource.newComparator() and SortField.getComparator() no longer throw IOException
    (Alan Woodward)
  • : Scorer.getChildren() now only returns Scorers that are positioned on the current document, and can throw an IOException. AssertingScorer checks that getChildren() is not called on an unpositioned Scorer.
    (Alan Woodward, Adrien Grand)
  • : TopDocs.merge now takes a boolean option telling it when to use the incoming shard index versus when to assign the shard index itself, allowing users to merge shard responses incrementally instead of once all shard responses are present.
    (Simon Willnauer, Mike McCandless)

 

Lucene6.6改动:

修复了一些BUG无API改动!

转载于:https://www.cnblogs.com/jetHu/p/7446839.html

你可能感兴趣的文章
PHP上传RAR压缩包并解压目录
查看>>
codeforces global round 1题解搬运
查看>>
python os模块
查看>>
Codeforces 719B Anatoly and Cockroaches
查看>>
jenkins常用插件汇总
查看>>
c# 泛型+反射
查看>>
第九章 前后查找
查看>>
Python学习资料
查看>>
多服务器操作利器 - Polysh
查看>>
[LeetCode] Candy
查看>>
Jmeter学习系列----3 配置元件之计数器
查看>>
jQuery 自定义函数
查看>>
jq 杂
查看>>
jquery datagrid 后台获取datatable处理成正确的json字符串
查看>>
作业一
查看>>
AJAX
查看>>
ActiveMQ与spring整合
查看>>
web服务器
查看>>
Git的使用--打tag
查看>>
F# 编程 借助 F# 构建 MVVM 应用程序
查看>>