コミット:
ハードをコミットします。これは、クライアントからsolrconfig.xmlまたは明示的な呼び出しではautoCommitオプション(SolrJまたはHTTP経由で支配されています ブラウザ、cURLなど)。ハードコミットは現在のセグメント を切り捨て、インデックスに新しいセグメントを開きます。 openSearcher:新たにコミットされた データが後続の検索で見えるようにするかどうかを制御するブール値 のサブプロパティ
ソフトコミット:ハードコミット(openSearcher = true)より安価な操作で、ドキュメントを検索可能にします。
上記のテキストは、thisソースから引用しています。追加情報があります。
ドキュメントを追加すると、上記のコミットのいずれかが発生するまでコミットされません。 solrconfig.xmlで、コミットオプションのデフォルト値を確認できます。 通常は、アプリケーションのニーズに応じてハードおよびソフトのコミット時間を調整し、エントリをディスクに直接書き込む必要がない限り、コードから明示的にコミットする必要はありません。
<!-- AutoCommit
Perform a hard commit automatically under certain conditions.
Instead of enabling autoCommit, consider using "commitWithin"
when adding documents.
http://wiki.apache.org/solr/UpdateXmlMessages
maxDocs - Maximum number of documents to add since the last
commit before automatically triggering a new commit.
maxTime - Maximum amount of time in ms that is allowed to pass
since a document was added before automatically
triggering a new commit.
openSearcher - if false, the commit causes recent index changes
to be flushed to stable storage, but does not cause a new
searcher to be opened to make those changes visible.
If the updateLog is enabled, then it's highly recommended to
have some sort of hard autoCommit to limit the log size.
-->
<autoCommit>
<maxTime>600000</maxTime>
<openSearcher>false</openSearcher>
</autoCommit>
<!-- softAutoCommit is like autoCommit except it causes a
'soft' commit which only ensures that changes are visible
but does not ensure that data is synced to disk. This is
faster and more near-realtime friendly than a hard commit.
-->
<autoSoftCommit>
<maxTime>30000</maxTime>
</autoSoftCommit>
Solrにはで、SoftCommitに自動的にドキュメントを行います30秒ごとに実行されます:あなたは次のように柔らかくhardcommit設定を含めるために、あなたのsolrconfig.xmlを変更した場合、より具体的には
Searchに表示され、10分ごとに強制コミットされます。
solrClient.add(SolrInputDocument doc)
はsolrClient.commit()の呼び出しを必要とせず、10分後に30秒とハードコミット後にコミットソフトになります:あなたが使用してSolrJで追加何でもそう 、。
出典
2016-08-04 09:06:02
AR1
質問の文脈で説明できますか? – gaurav5430