lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mordo, Aviran (EXP N-NANNATEK)" <>
Subject RE: Hits sorted
Date Tue, 11 Oct 2005 19:18:11 GMT
Just use the Sort option in the searcher


-----Original Message-----
From: Daniel Cortes [] 
Sent: Tuesday, October 11, 2005 2:58 PM
Subject: Hits sorted

Hi everybody, I have a problem when I find all the documents added in
the last days in my index. It works good but I want show this results
sorted. What I have to do?

My code is this:

    private RangeQuery findINTODates(int days) {
        Term from;
        Term to;

        Calendar calendar = new GregorianCalendar();
        SimpleDateFormat originalFormatter = new SimpleDateFormat
        from = new
        to = new Term("DATE",originalFormatter.format(new Date()));

        RangeQuery lastdays= new RangeQuery(from,to,true);

        return lasdays;

and I call this


What I have to do? I have to use DateFilter or Sort elements ?  I don't
know how to work with these classes.
In mMy documents of lucene I added the field Date how a string and not
how a date because it's more easy for add documents to index in my case.

thks for all.

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message