我提出了一个solr排序的问题。我将一些数据加载到具有两个字段的singleinstance solr中:
field name="timestamp" type="long" indexed="true" stored="true"
field name="sequence" type="int" indexed="true" stored="true"
然后我用
查询它url:http://localhost:8080/solr/second/select?q=*%3A*%0A&sort=timestamp+asc%2Csequence+asc+&fl=timestamp%2Csequence&wt=json&indent=true
但结果就是
"sort":"timestamp asc,sequence asc ",
"wt":"json"}},
"response":{"numFound":3000,"start":0,"docs":[
{
"timestamp":1000001210375,
"sequence":5},
{
"timestamp":1000001995899,
"sequence":9},
{
"timestamp":1000002980757,
"sequence":7},
{
"timestamp":1000005311535,
"sequence":5},
{
"timestamp":1000007582420,
"sequence":0},
{
"timestamp":1000007754398,
"sequence":0},
{
"timestamp":1000007820065,
"sequence":5},
{
"timestamp":1000008875407,
"sequence":7},
{
"timestamp":1000009462491,
"sequence":5},
{
"timestamp":1000010136221,
"sequence":1}]
}}
它以正确的方式对时间戳进行排序,但不在asc
中对排序顺序进行排序任何人都知道为什么?谢谢..
答案 0 :(得分:0)
它按时间戳排序然后排序,因此只有当时间戳值相同时才按顺序值排序。