/** * Creates an IndexWriter for given index path, with a SimpleAnalyzer. * * @param indexPath the path to the index directory * @param create set to true if you want to create a new index * @return the IndexWriter * @throws IOException */ public static IndexWriter createIndexWriter(String indexPath, boolean create) throws IOException { return createIndexWriter(indexPath, create, AnalyzerType.SimpleAnalyzer); //TODO: Simple or Standard ?? }
/** * Creates an IndexWriter for given index path, with a SimpleAnalyzer. * * @param indexPath the path to the index directory * @param create set to true if you want to create a new index * @return the IndexWriter * @throws IOException */ public static IndexWriter createIndexWriter(String indexPath, boolean create) throws IOException { return createIndexWriter(indexPath, create, AnalyzerType.SimpleAnalyzer); //TODO: Simple or Standard ?? }
public LuceneIndexWriter(File infile, File indexDirectory, boolean doHashingBitSampling, boolean doMetricSpaceIndexing, boolean useDocValues) throws IOException { super(infile, useDocValues, doHashingBitSampling, doMetricSpaceIndexing); this.iw = LuceneUtils.createIndexWriter(indexDirectory.getPath(), true, LuceneUtils.AnalyzerType.WhitespaceAnalyzer); }
public LuceneIndexWriter(File infile, File indexDirectory, boolean doHashingBitSampling, boolean doMetricSpaceIndexing, boolean useDocValues) throws IOException { super(infile, useDocValues, doHashingBitSampling, doMetricSpaceIndexing); this.iw = LuceneUtils.createIndexWriter(indexDirectory.getPath(), true, LuceneUtils.AnalyzerType.WhitespaceAnalyzer); }
/** * Creates an IndexWriter for given index path, with given analyzer. * * @param indexPath the path to the index directory * @param create set to true if you want to create a new index * @param analyzer gives the analyzer used for the Indexwriter. * @return an IndexWriter * @throws IOException */ public static IndexWriter createIndexWriter(String indexPath, boolean create, AnalyzerType analyzer) throws IOException { return createIndexWriter(FSDirectory.open(Paths.get(indexPath)), create, analyzer); }
/** * Creates an IndexWriter for given index path, with given analyzer. * * @param indexPath the path to the index directory * @param create set to true if you want to create a new index * @param analyzer gives the analyzer used for the Indexwriter. * @return an IndexWriter * @throws IOException */ public static IndexWriter createIndexWriter(String indexPath, boolean create, AnalyzerType analyzer) throws IOException { return createIndexWriter(FSDirectory.open(Paths.get(indexPath)), create, analyzer); }
public void run() { // do it ... try { IndexWriter indexWriter = LuceneUtils.createIndexWriter(indexPath, false, LuceneUtils.AnalyzerType.WhitespaceAnalyzer); // IndexWriterConfig config = new IndexWriterConfig(LuceneUtils.LUCENE_VERSION, new WhitespaceAnalyzer(LuceneUtils.LUCENE_VERSION)); // config.setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND); // config.setCodec(new LireCustomCodec()); // IndexWriter indexWriter = new IndexWriter(FSDirectory.open(new File(indexPath)), config); for (Iterator<File> iterator = inputFiles.iterator(); iterator.hasNext(); ) { File inputFile = iterator.next(); if (verbose) System.out.println("Processing " + inputFile.getPath() + "."); readFile(indexWriter, inputFile); if (verbose) System.out.println("Indexing finished."); } LuceneUtils.commitWriter(indexWriter); // LuceneUtils.optimizeWriter(indexWriter); LuceneUtils.closeWriter(indexWriter); // indexWriter.commit(); // indexWriter.close(); } catch (Exception e) { e.printStackTrace(); } }
public void run() { // do it ... try { IndexWriter indexWriter = LuceneUtils.createIndexWriter(indexPath, false, LuceneUtils.AnalyzerType.WhitespaceAnalyzer); // IndexWriterConfig config = new IndexWriterConfig(LuceneUtils.LUCENE_VERSION, new WhitespaceAnalyzer(LuceneUtils.LUCENE_VERSION)); // config.setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND); // config.setCodec(new LireCustomCodec()); // IndexWriter indexWriter = new IndexWriter(FSDirectory.open(new File(indexPath)), config); for (Iterator<File> iterator = inputFiles.iterator(); iterator.hasNext(); ) { File inputFile = iterator.next(); if (verbose) System.out.println("Processing " + inputFile.getPath() + "."); readFile(indexWriter, inputFile); if (verbose) System.out.println("Indexing finished."); } LuceneUtils.commitWriter(indexWriter); // LuceneUtils.optimizeWriter(indexWriter); LuceneUtils.closeWriter(indexWriter); // indexWriter.commit(); // indexWriter.close(); } catch (Exception e) { e.printStackTrace(); } }
public void run() { IndexWriter indexWriter = LuceneUtils.createIndexWriter(indexPath, overwriteIndex, LuceneUtils.AnalyzerType.WhitespaceAnalyzer); for (Iterator<File> iterator = inputFiles.iterator(); iterator.hasNext(); ) { File inputFile = iterator.next();
public void run() { IndexWriter indexWriter = LuceneUtils.createIndexWriter(indexPath, overwriteIndex, LuceneUtils.AnalyzerType.WhitespaceAnalyzer); for (Iterator<File> iterator = inputFiles.iterator(); iterator.hasNext(); ) { File inputFile = iterator.next();
try { long start = System.currentTimeMillis(); writer = LuceneUtils.createIndexWriter(indexPath, overWrite, LuceneUtils.AnalyzerType.WhitespaceAnalyzer); if (imageList == null) {
try { long start = System.currentTimeMillis(); writer = LuceneUtils.createIndexWriter(indexPath, overWrite, LuceneUtils.AnalyzerType.WhitespaceAnalyzer); if (imageList == null) {
/** * Creates an IndexWriter for given index path, with a SimpleAnalyzer. * * @param indexPath the path to the index directory * @param create set to true if you want to create a new index * @return the IndexWriter * @throws IOException */ public static IndexWriter createIndexWriter(String indexPath, boolean create) throws IOException { return createIndexWriter(indexPath, create, AnalyzerType.SimpleAnalyzer); }
/** * Creates an IndexWriter for given index path, with given analyzer. * * @param indexPath the path to the index directory * @param create set to true if you want to create a new index * @param analyzer gives the analyzer used for the Indexwriter. * @return an IndexWriter * @throws IOException */ public static IndexWriter createIndexWriter(String indexPath, boolean create, AnalyzerType analyzer) throws IOException { return createIndexWriter(FSDirectory.open(new File(indexPath)), create, analyzer); }
public void run() { IndexWriter indexWriter = LuceneUtils.createIndexWriter(indexPath, overwriteIndex, LuceneUtils.AnalyzerType.WhitespaceAnalyzer); for (Iterator<File> iterator = inputFiles.iterator(); iterator.hasNext(); ) { File inputFile = iterator.next();
IndexWriter iw = LuceneUtils.createIndexWriter(indexPath + "-ro", true); HashSet<Integer> referenceObjsIds = new HashSet<Integer>(numReferenceObjects);
time = System.currentTimeMillis(); int[] tmpHist = new int[numClusters]; IndexWriter iw = LuceneUtils.createIndexWriter(((DirectoryReader) reader).directory(), true, LuceneUtils.AnalyzerType.WhitespaceAnalyzer, 256d); if (pm != null) { // set to 50 of 100 after clustering. pm.setProgress(50);
time = System.currentTimeMillis(); int[] tmpHist = new int[numClusters]; IndexWriter iw = LuceneUtils.createIndexWriter(((DirectoryReader) reader).directory(), true, LuceneUtils.AnalyzerType.WhitespaceAnalyzer, 256d); if (pm != null) { // set to 50 of 100 after clustering. pm.setProgress(50);
IndexWriter iw = LuceneUtils.createIndexWriter(((DirectoryReader) reader).directory(), false, LuceneUtils.AnalyzerType.WhitespaceAnalyzer); for (int i = 0; i < reader.maxDoc(); i++) {
IndexWriter iw = LuceneUtils.createIndexWriter(((DirectoryReader) reader).directory(), true, LuceneUtils.AnalyzerType.WhitespaceAnalyzer); for (int i = 0; i < reader.maxDoc(); i++) {