This is because you tokenized/analyzed the field. It is sorted against the 
lowest term in the field ("sundheimer" is the largest value of all terms, so 
sorted first). This is why you cannot tokenize/analyze fields to sort against.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de


> -----Original Message-----
> From: johnbesel [mailto:johnbe...@web.de]
> Sent: Monday, January 21, 2013 2:29 PM
> To: general@lucene.apache.org
> Subject: Re: Indexer search with filter and sort
> 
> I made  a Junit Test with some values. I sort values DESC and get following:
> 
> im sundheimer fort 1-9
> krammwinkel/surkampstr.78
> sundweg
> bray-sur-seine-str. 1
> bray-sur-seine-str. 1
> berck-sur-mer-str. 1
> 
> 
> this is not DESC, but also not ASC. what is this????
> SortField field=new SortField(sortKey, SortField.STRING, true);
> List<SortField> luceneSortFields = new ArrayList<SortField>();
> luceneSortFields.add(field);
> 
> Sort sort = new Sort(luceneSortFields.toArray(new
> SortField[luceneSortFields.size()]));
> topDocs = indexSearcher.search(booleanQuery, Integer.MAX_VALUE, sort);
> 
> has anybody any Idea??
> what is wrong in my implementation?
> 
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Indexer-
> search-with-filter-and-sort-tp4034733p4035047.html
> Sent from the Lucene - General mailing list archive at Nabble.com.

Reply via email to