【问题标题】:solr autoSoftCommit will open new searcher?solr autoSoftCommit 会打开新的搜索器吗?
【发布时间】:2013-06-13 09:29:25
【问题描述】:

这是我的 solrconfig.xml 部分:

 <autoCommit> 
    <maxTime>15000</maxTime> 
    <openSearcher>false</openSearcher>
  </autoCommit>
   <autoSoftCommit> 
    <maxTime>1000</maxTime>
  </autoSoftCommit>

这是测试添加文档命令:

curl http://localhost:8983/solr/AluSupply/update/json 
-H 'Content-Type:application/json' 
-d '[{ "CompanyRoleId": 1, 
    "Description": " hello test", 
    "CityId": 1404, 
    "CompanyId": 32733,
    "SupplyTitle": "this is title", 
    "Id":399998}]'

我观察到autoSoftCommit,总是打开一个新的org.apache.solr.search.SolrIndexSearcher,这是否会严重影响性能呢?

这是日志信息:

9117 [commitScheduler-7-thread-1] INFO org.apache.solr.update.UpdateHandler – 开始提交{,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=true,prepareCommit=错误}

9142 [commitScheduler-7-thread-1] INFO org.apache.solr.search.SolrIndexSearcher – 打开 Searcher@648353f6 main

9143 [commitScheduler-7-thread-1] 信息 org.apache.solr.update.UpdateHandler – end_commit_flush

9144 [searcherExecutor-4-thread-1] INFO org.apache.solr.core.SolrCore – QuerySenderListener 发送请求到 Searcher@648353f6 main{StandardDirectoryReader(segments_nf:3441:nrt _194(4.3):C2/1 _19n( 4.3):C1)}

9144 [searcherExecutor-4-thread-1] INFO org.apache.solr.core.SolrCore – QuerySenderListener 完成。

9147 [searcherExecutor-4-thread-1] INFO org.apache.solr.core.SolrCore – [AluSupply] 注册新搜索器 Searcher@648353f6 main{StandardDirectoryReader(segments_nf:3441:nrt _194(4.3):C2/1 _19n(4.3):C1)}

【问题讨论】:

    标签: java search solr lucene full-text-search


    【解决方案1】:

    当 solr do autoSoftCommit 时,它会打开一个基于 RAMDirectory 的新 SolrIndexSearcher。

    所以这不会影响性能。

    autoCommit 会将文档写入硬盘,并重新打开 IndexSearcher,这会严重影响性能。

    【讨论】:

      猜你喜欢
      • 2013-07-13
      • 2015-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多