2017-07-25 82 views
0

在另一個SO問題上,我要求澄清我對不同類型的solr提交的理解。這是螺紋連接Understanding the different type of SOLR commitssolr comiit params的默認值是多少?

現在,基本上我想知道Solr的下面會發生什麼,當我通過commit=truecommit=false任何Solr的POST請求。

提交=真正

curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/keywords/update/json/docs?commit=true' --data-binary '{ "id": "550148", "keyword": "astle city", "formatted_address": "Auckland, New Zealand", "country_code": "NZ", "region": "Auckland", "place": "Auckland", "lat": "-36.84846", "lng": "174.763332", "update_date": "2015-10-0500: 49: 35", "index": "0", "north": "NULL", "south": "NULL", "east": "NULL", "west": "NULL" }' 

提交= FALSE

curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/keywords/update/json/docs?commit=false' --data-binary '{ "id": "550148", "keyword": "astle city", "formatted_address": "Auckland, New Zealand", "country_code": "NZ", "region": "Auckland", "place": "Auckland", "lat": "-36.84846", "lng": "174.763332", "update_date": "2015-10-0500: 49: 35", "index": "0", "north": "NULL", "south": "NULL", "east": "NULL", "west": "NULL" }' 

什麼是承諾PARAMS時,我不把它的默認值?

回答

1

正如前面的回答中提到的那樣,仔細看看這個位[3]。

如果您通過「提交」參數,您要求一個硬提交。 如果你不這樣做,就不會發生提交。 在搜索器打開之前,您無法搜索您索引的文檔。 告訴Solr打開搜索器的方法是使用軟提交或硬提交(open searcher = true)。

直到你提交,您不能搜索這些文件,並可能你甚至不沖洗它們,以您的Lucene的目錄(這取決於你的RAMBuffer爲好,但它是一個不同的故事)

[ 3] https://cwiki.apache.org/confluence/display/solr/UpdateHandlers+in+SolrConfig#UpdateHandlersinSolrConfig-commitandsoftCommit

+0

再次感謝您的回答。我明白了,如果沒有搜索者被打開(open searcher = true),我將無法搜索我編入索引的文檔,並打開我需要做Soft Commit或Hard commit的搜索者。所以基本上'commit = true'就是硬提交,'commit = false'就是軟提交。我對嗎 ?如果我沒有使用我的url設置任何東西,commit param的默認值是什麼? –

+0

不是。您是否閱讀過文檔? commit = false不是軟提交。 它根本沒有提交。 softCommit = true是軟提交。 –

+1

現在感謝了 –

1

簡單地說,提交意味着適用於更新文檔的索引數據。 如果commit = false,只記錄tlog並且不能被搜索。 但是commit = true,可以用新的搜索器搜索更新的文檔。 (特別是使用openSearcher = false更新,它也不能被搜索到。)

+0

如果我設置提交= true和openSearcher = true是硬提交(我將能夠搜索文檔),如果我設置提交= true和openSearcher = false是軟提交(我將無法搜索文件)? –

+0

閱讀本文,https://lucidworks.com/2013/08/23/understanding-transaction-logs-softcommit-and-commit-in-sorlcloud/ – han058

相關問題