Package com.dotcms.repackage.org.apache.lucene.index

Examples of com.dotcms.repackage.org.apache.lucene.index.IndexWriter


      else {
        String luceneDir = LuceneUtil.getLuceneDir(_companyId);

        FileUtil.mkdirs(luceneDir);

        IndexWriter writer = null;

                try {

                    Directory directory = FSDirectory.open( new File( luceneDir ) );
                    IndexWriterConfig config = new IndexWriterConfig( Version.LUCENE_CURRENT, new WhitespaceAnalyzer( Version.LUCENE_CURRENT ) );
                    /*
                    IndexWriterConfig.OpenMode.CREATE_OR_APPEND if used IndexWriter will create a new index if there is not
                    already an index at the provided path and otherwise open the existing index.
                     */
                    config.setOpenMode( IndexWriterConfig.OpenMode.CREATE_OR_APPEND );

                    writer = new IndexWriter( directory, config );
                } catch ( IOException e ) {
                    Logger.error( this, e.getMessage(), e );
                }
            }
    }
View Full Code Here


    String luceneDir = LuceneUtil.getLuceneDir(_companyId);

    FileUtil.deltree(luceneDir);

    try {
      IndexWriter writer = LuceneUtil.getWriter(_companyId, true);

      writer.close();
    }
    catch (IOException ioe) {
      Logger.error(LuceneIndexer.class,ioe.getMessage(),ioe);
    }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.apache.lucene.index.IndexWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.