AnsweredAssumed Answered

How to show the last N modified documents?

Question asked by jzulu2000 on Jun 10, 2008
Latest reply on Dec 11, 2008 by mikeh
Hi

I have a lucene search that returns about 15 elements, but I only want to show the last 3 modifieds from that list.
In a script I coded as follows
var totalResults = search.luceneSearch("(TEXT:***)");
model.resultset = totalResults;
The freemarker template does:
<?xml version="1.0" encoding="UTF-8"?>
<list>
<#list resultset as doc>
<item>${doc.name}</item>
</#list>
</list>

I know how to sort by name, using <#list resultset?sort_by("name") as doc>, but it seems like the resultset objects doesn't contain the modified date field to sort by.

Is there any way to sort the resultset by modified date?

After ordering by modified date, I will do a reverse and take only 3 elements.

Thanks

Outcomes