2014-02-06 25 views

回答

1

您需要在endtime的架构中使用sortMissingLast

http://lucene.472066.n3.nabble.com/about-sortMissingLast-and-sortMissingFirst-td473881.html - if sortMissingLast=true then it doesn't matter whether you sort "asc" or "desc", documents that don't have a value for that field will always come last. if sortMissingLast="false" then the default Lucene sort behavior is used, in which "missing" values are sorted the same as empty strings -- it is the "lowest" possible value, so they come first in asc sorts.

一旦你的,你都可以发出此查询: q=*:*&sort=endtime desc,starttime desc

(我不知道为什么你需要从starttime减去100,因为排序顺序将是相同)。