0

I would like to well understand Solr merge behaviour. I did some researches on the different merge policies. And it seems that the TieredMergePolicy is better than old merge policies (LogByteSizeMergePolicy, etc ...). That's why I use this one and that's the default policy on last solr versions.

First, I give you some interesting links that I've read to have a better idea of merge process : http://java.dzone.com/news/merge-policy-internals-solr http://blog.mikemccandless.com/2011/02/visualizing-lucenes-segment-merges.html

According to the official documentation of Lucene, I would like to ask several questions on it : http://lucene.apache.org/core/3_2_0/api/all/org/apache/lucene/index/TieredMergePolicy.html

Questions

1- In the official documentation, there is one method called setExpungeDeletesPctAllowed(double v). And in the Solr 4.3.0, I have checked in the TieredMergePolicy class and I didn't find this method. There is another method that look like this one, called : setForceMergeDeletesPctAllowed(double v). Is there any differences between both methods ?

2- Are both methods above called only when you do a ExpungeDelete and an optimization or Are they called when a normal merge.

3- I've read that merges beetween segments are done according a pro-rata of deleted documents percentage on a segment. By default, this percentage is set to 10%. Does it possible to set this value to 0% to be sure that there is no more deleted documents in the index after merging ?

I need to reduce the size of my index without call optimize() method if it's possible. That's why any informations about merge process would be interesting for me.

Thanks

4

1 に答える 1

3

ドキュメントを混同しているようです。Lucene 4.3.0 を使用している場合はTieredMergePolicy、バージョン 3.2.0 ではなく、そのドキュメント (4.3.0 の正しいドキュメントを参照) を使用してください。

とにかく、これらの特定の質問については、 #Lucene-3577 を参照してください。

1 - すべての意図と目的のために、主に必要な名前の変更のようです。

2 - まず、IndexWriter.expungeDeletes4.3.0 には存在しません。必要に応じて を使用できますがIndexWriter.forceMergeDeletes()、非常にコストがかかるため、使用しないことを強くお勧めします。これは通話にのみ影響すると思いForceMergeDeletes()ます。削除の再利用を希望する場合は、MergePolicy で次のように設定します。 TieredMergePolicy.setReclaimDeletesWeight

3 - 許可されたパーセントは、最初の質問で示したメソッド呼び出しにあります。ただし、呼び出し時にすべての削除を強制的にマージするとForceMergeDeletes()、すでに非常に高価な操作がさらに高価になります。

あえて推測してみると、インデックスが使用するディスク スペースを節約する必要がある場合は、インデックスに格納されているデータの量をより詳しく調べることで、はるかにうまくいく可能性があります。もちろん、確実に言うには十分な情報ではありませんが、考慮すべき解決策のようです。

于 2013-08-21T20:37:41.790 に答える