[英]solr. what does it mean numfound?
我試圖了解solr官方教程。
我查詢:
http://localhost:8983/solr/collection1/select/?indent=on&q=*&fl=name,id
並查看下一個響應:
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">125</int>
<lst name="params">
<str name="fl">name,id</str>
<str name="indent">on</str>
<str name="q">*</str>
</lst>
</lst>
<result name="response" numFound="28" start="0">
<doc>...</doc>
<doc>...</doc>
<doc>...</doc>
<doc>...</doc>
<doc>...</doc>
<doc>...</doc>
<doc>...</doc>
<doc>...</doc>
<doc>...</doc>
<doc>...</doc>
</result>
</response>
為什么numfound等於28但文檔號是10?
如果您將查詢更改為
http://localhost:8983/solr/collection1/select/?indent=on&q=*&fl=name,id&rows=1000000
rows=
參數指定要返回的結果數。 值為1000000時,您將有效地獲取所有文檔(不僅僅是前10個,這是默認值)。
如果您想更小心一點,可以閱讀numFound
參數,然后多次調用以返回數據塊。
http://localhost:8983/solr/collection1/select/?indent=on&q=*&fl=name,id&start=0
http://localhost:8983/solr/collection1/select/?indent=on&q=*&fl=name,id&start=10
http://localhost:8983/solr/collection1/select/?indent=on&q=*&fl=name,id&start=20
這將分別返回10、10和8個文檔。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.