public Analyzer getAnalyzer() { return new NexusAnalyzer(); }
@Override protected TokenStreamComponents createComponents(String fieldName, Reader reader) { return new TokenStreamComponents(getTokenizer(fieldName, reader)); }
protected int countTerms( final IndexerField indexerField, final String query ) { try { TokenStream ts = nexusAnalyzer.tokenStream(indexerField.getKey(), new StringReader(query)); ts.reset(); int result = 0; while ( ts.incrementToken() ) { result++; } ts.end(); ts.close(); return result; } catch ( IOException e ) { // will not happen return 1; } } }
protected int countTerms( final IndexerField indexerField, final String query ) { try { TokenStream ts = nexusAnalyzer.tokenStream( indexerField.getKey(), new StringReader( query ) ); ts.reset(); int result = 0; while ( ts.incrementToken() ) { result++; } ts.end(); ts.close(); return result; } catch ( IOException e ) { // will not happen return 1; } } }
public Analyzer getAnalyzer() { return new NexusAnalyzer(); }
protected int countTerms( final IndexerField indexerField, final String query ) { try { TokenStream ts = nexusAnalyzer.tokenStream( indexerField.getKey(), new StringReader( query ) ); ts.reset(); int result = 0; while ( ts.incrementToken() ) { result++; } ts.end(); ts.close(); return result; } catch ( IOException e ) { // will not happen return 1; } } }
public Analyzer getAnalyzer() { return new NexusAnalyzer(); }
public Analyzer getAnalyzer() { return new NexusAnalyzer(); }
public Analyzer getAnalyzer() { return new NexusAnalyzer(); }
public Analyzer getAnalyzer() { return new NexusAnalyzer(); }
public static IndexWriterConfig defaultConfig() { final IndexWriterConfig config = new IndexWriterConfig( Version.LUCENE_46, new NexusAnalyzer() ); // default open mode is CreateOrAppend which suits us config.setRAMBufferSizeMB( 2.0 ); // old default config.setMergeScheduler( new SerialMergeScheduler() ); // merging serially config.setWriteLockTimeout(IndexWriterConfig.WRITE_LOCK_TIMEOUT); return config; } }
public static IndexWriterConfig defaultConfig() { final IndexWriterConfig config = new IndexWriterConfig( new NexusAnalyzer() ); // default open mode is CreateOrAppend which suits us config.setRAMBufferSizeMB( 2.0 ); // old default config.setMergeScheduler( new SerialMergeScheduler() ); // merging serially config.setWriteLockTimeout( IndexWriterConfig.WRITE_LOCK_TIMEOUT ); return config; } }
public static IndexWriterConfig defaultConfig() { final IndexWriterConfig config = new IndexWriterConfig( new NexusAnalyzer() ); // default open mode is CreateOrAppend which suits us config.setRAMBufferSizeMB( 2.0 ); // old default config.setMergeScheduler( new SerialMergeScheduler() ); // merging serially config.setWriteLockTimeout( IndexWriterConfig.WRITE_LOCK_TIMEOUT ); return config; } }
/** * Unpack index data using specified Lucene Index writer * * @param is an input stream to unpack index data from * @param w a writer to save index data * @param ics a collection of index creators for updating unpacked documents. */ public static IndexDataReadResult unpackIndexData( final InputStream is, final Directory d, final IndexingContext context ) throws IOException { NexusIndexWriter w = new NexusIndexWriter( d, new NexusAnalyzer(), true ); try { IndexDataReader dr = new IndexDataReader( is ); return dr.readIndex( w, context ); } finally { IndexUtils.close( w ); } }
/** * Unpack index data using specified Lucene Index writer * * @param is an input stream to unpack index data from * @param w a writer to save index data * @param ics a collection of index creators for updating unpacked documents. */ public static IndexDataReadResult unpackIndexData( final InputStream is, final Directory d, final IndexingContext context ) throws IOException { NexusIndexWriter w = new NexusIndexWriter( d, new NexusAnalyzer(), true ); try { IndexDataReader dr = new IndexDataReader( is ); return dr.readIndex( w, context ); } finally { IndexUtils.close( w ); } }
/** * Unpack index data using specified Lucene Index writer * * @param is an input stream to unpack index data from * @param w a writer to save index data * @param ics a collection of index creators for updating unpacked documents. */ public static Date unpackIndexData( final InputStream is, final Directory d, final IndexingContext context ) throws IOException { NexusIndexWriter w = new NexusIndexWriter( d, new NexusAnalyzer(), true ); try { IndexDataReader dr = new IndexDataReader( is ); IndexDataReadResult result = dr.readIndex( w, context ); return result.getTimestamp(); } finally { IndexUtils.close( w ); } }
QueryParser qp = new QueryParser( field, new NexusAnalyzer() );
w = new NexusIndexWriter( directory, new NexusAnalyzer(), false ); w = new NexusIndexWriter( directory, new NexusAnalyzer(), false );
QueryParser qp = new QueryParser( field, new NexusAnalyzer() );
QueryParser qp = new QueryParser( Version.LUCENE_46, field, new NexusAnalyzer() );