Solr / admin / luke请求有时返回null

时间:2019-06-05 00:34:24

标签: solr solrj solrcloud

我正在尝试从Solr获取一些元数据(文档计数和上次修改日期),并发现/solr/<core>/admin/luke端点可以做到这一点。

但是,我的请求有时返回空值而不是值。我可以通过SolrJ和curl来复制它:

  

✗curl主机名/ solr / core_name / admin / luke -s | jq'.index.lastModified'

     

“ 2019-06-04T19:59:45.617Z”

     

✗curl主机名/ solr / core_name / admin / luke -s | jq'.index.lastModified'

     

没有jq的结果是:

{
  "responseHeader":{
    "status":0,
    "QTime":2},
  "index":{
    "numDocs":11,
    "maxDoc":11,
    "deletedDocs":0,
    "indexHeapUsageBytes":-1,
    "version":6,
    "segmentCount":1,
    "current":true,
    "hasDeletions":false,
    "directory":"org.apache.lucene.store.NRTCachingDirectory:NRTCachingDirectory(MMapDirectory@ ... lockFactory=org.apache.lucene.store.NativeFSLockFactory@2846d2cf; maxCacheMB=48.0 maxMergeSizeMB=4.0)",
    "segmentsFile":"segments_1",
    "segmentsFileSizeInBytes":-1,
    "userData":{
      "commitTimeMSec":"1559730066881",
      "commitCommandVer":"1635495514608762880"},
    "lastModified":"2019-06-05T10:21:06.881Z"},
  "fields":{ .... },
  "info":{ .... }
}

或:

{
  "responseHeader":{
    "status":0,
    "QTime":2},
  "index":{
    "numDocs":11,
    "maxDoc":11,
    "deletedDocs":0,
    "indexHeapUsageBytes":-1,
    "version":4,
    "segmentCount":1,
    "current":false,
    "hasDeletions":false,
    "directory":"org.apache.lucene.store.NRTCachingDirectory:NRTCachingDirectory(MMapDirectory@ .... lockFactory=org.apache.lucene.store.NativeFSLockFactory@1e10c435; maxCacheMB=48.0 maxMergeSizeMB=4.0)",
    "segmentsFile":"segments_1",
    "segmentsFileSizeInBytes":-1,
    "userData":{}},
  "fields":{ .... },
  "info":{ .... }
}

我省略了index.directoryfieldsinfo的一部分。区别在于versioncurrentuserDatalastModified,其他所有内容看起来都一样。

我正在Cloud模式下使用Solr 7.5。我的集合位于副本数= 2(或更多)的多个分片上。我尝试将?numTerms=50添加到请求中,但这无济于事。

我可以做些什么来始终得到正确的答复吗?

0 个答案:

没有答案