我正在执行 SOLR 查询,在其中对标题进行分组并限制组中的标题数量。我面临的问题是我没有得到与通过限制匹配的确切数量。
例如:
http://localhost:8080/solr/select?wt=json&indent=true&fl=publication,book_code,bookID,book_date,book_images&q=asset_type:Book+AND+AND+engineering:true&group=true&group.field=book_code&group.limit=3&rows=50000&group.sort=book_date+desc
如何转换此查询以便一次获取 10000 条记录。
目前返回的结果:
{"responseHeader"=>
{"status"=>0,
"QTime"=>195,
"params"=>
{"fl"=>"publication,book_code,BookID,book_date,book_images",
"indent"=>"true",
"q"=>"doc_type:Book AND engineering:true",
"group.limit"=>"3",
"group.field"=>"book_code",
"group.sort"=>"book_date desc",
"group"=>"true",
"wt"=>"json",
"rows"=>"50000"}},
"grouped"=>
{"book_code"=>
{"matches"=>30216,
"groups"=>
[{"groupValue"=>"NYM",
"doclist"=>
{"numFound"=>2683,
"start"=>0,
"docs"=>
[{"book_code"=>"NYM", .... } and so on
当我尝试检索分组书籍的数量时,我得到:
result["grouped"]["book_code"]["groups"].count #=> 276
与返回的匹配结果不匹配。