FAQ
hmm you can try creating

Sort sort = null;
SortField[] sortFields = new SortField[1];
sortFields[0] = new SortField(FIELD_TO_SEARCH, LOCALE,true**);
sort = new Sort(sortFields);

** org.apache.lucene.search.SortField<eclipse-javadoc:%E2%98%82=SearchIndexWeb/%5C/var%5C/www%5C/SearchIndexWeb%5C/WebContent%5C/WEB-INF%5C/lib%5C/lucene-core-3.0.2.jar%3Corg.apache.lucene.search%28SortField.class%E2%98%83SortField>
.SortField(String<eclipse-javadoc:%E2%98%82=SearchIndexWeb/%5C/var%5C/www%5C/SearchIndexWeb%5C/WebContent%5C/WEB-INF%5C/lib%5C/lucene-core-3.0.2.jar%3Corg.apache.lucene.search%28SortField.class%E2%98%83SortField%7ESortField%7ELjava.lang.String;%7ELjava.util.Locale;%7EZ%E2%98%82String>field,
Locale<eclipse-javadoc:%E2%98%82=SearchIndexWeb/%5C/var%5C/www%5C/SearchIndexWeb%5C/WebContent%5C/WEB-INF%5C/lib%5C/lucene-core-3.0.2.jar%3Corg.apache.lucene.search%28SortField.class%E2%98%83SortField%7ESortField%7ELjava.lang.String;%7ELjava.util.Locale;%7EZ%E2%98%82Locale>locale,
boolean reverse)
if you set last variable true it will walk reverse order.
then give it to Searcher object as a sort parameter
Searcher searcher = null;
TopFieldDocs topFieldDocs = searcher.search(query, AMOUNT_YOU_WANT, sort);




2010/8/23 Ryan McKinley <ryantxu@gmail.com>
Is there anyway to walk the terms in reverse order?

I have a query that need to find the last matching term -- if it could
start checking from the end, it would avoid a lot of work.

Thanks
Ryan

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

--
Erdinc Akkaya
Web Developer @ CE / Positive
www.positive.com.tr

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 3 | next ›
Discussion Overview
groupjava-user @
categorieslucene
postedAug 23, '10 at 2:58p
activeAug 23, '10 at 3:08p
posts3
users3
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase