lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johnbesel <>
Subject Indexer search with filter and sort
Date Sat, 19 Jan 2013 09:54:39 GMT
Hello together,

I work since 2 weeks with lucene and developed an application which put some
values into index and get it from it.

it works very good.

now I want to sort values, which I put into index.
I used a SortField to sort values:
new SortField(sortKey, SortField.STRING, SortDirection.DESC);

It didn't work. 
I found in internet that when I want to use a SortField with type String, I
should build Index with Index.NOT_ANALYZED.

I tested it, so now I could sort my values correct, BUT I could not search
for them :(

How can I search and sort String values ????

thank you for your help.

I use StandardAnalyzer and Lucene 3.6.
I put values into index
doc.add(new Field(KEY_CUSTOMER_NUMBER, customer.getKunnr() != null ?
customer.getKunnr() : "", Store.YES, Index.ANALYZED));

View this message in context:
Sent from the Lucene - General mailing list archive at

View raw message