Hi, it was not completely removed (it was intended to be removed). See the migration guide @ http://lucene.apache.org/core/4_3_1/MIGRATE.html, section about LUCENE-2514. The constructor and the logic was removed from SortField.
The "fast" replacement (means sorting works as fast without collating) is to index the fields used for sorting with CollationKeyAnalyzer (https://lucene.apache.org/core/4_3_1/analyzers-common/org/apache/lucene/collation/CollationKeyAnalyzer.html). The Collator you get from e.g. the locale. The slow replacement (which is factored out from the old SortField stuff using the locale) is: http://lucene.apache.org/core/4_3_1/sandbox/org/apache/lucene/sandbox/queries/SlowCollatedStringComparator.html - use this class a custom sort comparator in your SortField. But be warned: It is horrible slow. The better was is, as mentioned before, to index the collated sort keys in the index and do a binary sort on the (non human-readable) keys. Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: Trejkaz [mailto:trej...@trypticon.org] > Sent: Wednesday, July 10, 2013 6:22 AM > To: java-user@lucene.apache.org > Subject: Re: getLocale of SortField > > On Wed, Jul 10, 2013 at 12:53 AM, Uwe Schindler <u...@thetaphi.de> wrote: > > Hi, > > > > there is no more locale-based sorting in Lucene 4.x. It was deprecated > > in 3.x, so you should get a warning about deprecation already! > > I wasn't sure about this because we are on 3.6 and I didn't see a deprecation > warning in our code either. So I did some research. > > In 3.6.2, it was *NOT* deprecated: > > http://lucene.apache.org/core/3_6_2/api/all/org/apache/lucene/search/Sor > tField.html#SortField(java.lang.String, > java.util.Locale) > > In 4.0.0, it is completely removed: > > http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/search/Sort > Field.html > > Was there a release between 3.6.2 and 4.0.0 or did the Lucene project just > remove a constructor people were using with no warning nor direct > replacement? > > TX > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org