lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos de Luna Saenz <cdelunasa...@yahoo.com.mx>
Subject Re: SortField.STRING
Date Wed, 24 Oct 2012 20:49:51 GMT
Thanks... that's it... sorry to siturb with something that simple.





>________________________________
> De: Ian Lea <ian.lea@gmail.com>
>Para: java-user@lucene.apache.org; Carlos de Luna Saenz <cdelunasaenz@yahoo.com.mx>

>Enviado: Miércoles, 24 de octubre, 2012 1:55 P.M.
>Asunto: Re: SortField.STRING
> 
>SortField.Type.STRING maybe?
>
>Can't help with the other question.  It's generally best to send one
>question per message.  Looking at the source code might help.
>
>
>--
>Ian.
>
>
>On Wed, Oct 24, 2012 at 6:55 PM, Carlos de Luna Saenz
><cdelunasaenz@yahoo.com.mx> wrote:
>> I am migrating code from Lucene 3 to Lucene 4... and i have the following code that
i don't know how to change:
>>
>> hits = searcher.search(queryGlobal, searcher.maxDoc(),
>>                     new Sort(new SortField(ordenarPor, SortField.STRING)));
>>
>> I already change the searcher.maxDoc() to indxr.maxDoc() but SortField.STRING does
not exist anymore... what do i have to do?
>> In the same code i have a class called SpanishAnalyzer:
>> public class SpanishAnalyzer  extends Analyzer {
>>      public static final String[] SPANISH_STOP_WORDS = { "." };
>>
>>      private Set<Object> stopTable = new HashSet<Object>();
>>
>>      private Set<Object> exclTable = new HashSet<Object>();
>>
>>      public SpanishAnalyzer() {
>>         stopTable = StopFilter.makeStopSet(Version.LUCENE_40,SPANISH_STOP_WORDS);
>>
>>     }
>>      public SpanishAnalyzer(Version version){
>>          stopTable = StopFilter.makeStopSet(version,SPANISH_STOP_WORDS);
>>      }
>>
>>      public SpanishAnalyzer(String[] stopWords) {
>>         stopTable = StopFilter.makeStopSet(Version.LUCENE_40,stopWords);
>>     }
>>      public SpanishAnalyzer(File stopWords) throws IOException {
>>         stopTable = new HashSet(WordlistLoader.getWordSet(new FileReader(stopWords),
Version.LUCENE_40));
>>     }
>>
>> //    @Override
>> //    public TokenStream tokenStream(String fieldName, Reader reader) {
>> //        return new LowerCaseFilter(Version.LUCENE_40,new ASCIIFoldingFilter(
>> //                new StopFilter(Version.LUCENE_40,
>> //                                new StandardTokenizer(Version.LUCENE_40,
>> //                                                     
reader),
>> //                                stopTable)));
>> //    }
>>     @Override
>>     protected TokenStreamComponents createComponents(String string, Reader reader)
{
>>         throw new UnsupportedOperationException("Not supported yet.");
>>     }
>>
>> }
>>
>> The problem is that i can't override TokenStream anymore and now i have to implement
the createComponents method and i am not sure what do i supposed to do there... thanks in
advance for both troubles.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message