| HelpIndexerTool.java (d127360f) | HelpIndexerTool.java (7fb4469b) |
|---|---|
| 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 21 unchanged lines hidden (view full) --- 30import java.util.List; 31import java.util.zip.ZipEntry; 32import java.util.zip.ZipOutputStream; 33import java.util.zip.CRC32; 34import org.apache.lucene.analysis.standard.StandardAnalyzer; 35import org.apache.lucene.analysis.cjk.CJKAnalyzer; 36import org.apache.lucene.analysis.Analyzer; 37import org.apache.lucene.index.IndexWriter; | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 21 unchanged lines hidden (view full) --- 30import java.util.List; 31import java.util.zip.ZipEntry; 32import java.util.zip.ZipOutputStream; 33import java.util.zip.CRC32; 34import org.apache.lucene.analysis.standard.StandardAnalyzer; 35import org.apache.lucene.analysis.cjk.CJKAnalyzer; 36import org.apache.lucene.analysis.Analyzer; 37import org.apache.lucene.index.IndexWriter; |
| 38import org.apache.lucene.util.Version; 39import org.apache.lucene.store.NIOFSDirectory; |
|
| 38 39import java.io.File; 40import java.io.FileNotFoundException; 41import java.io.IOException; 42import java.util.Date; 43 | 40 41import java.io.File; 42import java.io.FileNotFoundException; 43import java.io.IOException; 44import java.util.Date; 45 |
| 44 45/** 46 When this tool is used with long path names on Windows, that is paths which start 47 with \\?\, then the caller must make sure that the path is unique. This is achieved 48 by removing '.' and '..' from the path. Paths which are created by 49 osl_getSystemPathFromFileURL fulfill this requirement. This is necessary because 50 lucene is patched to not use File.getCanonicalPath. See long_path.patch in the lucene 51 module. 52 */ | |
| 53public class HelpIndexerTool 54{ 55 public HelpIndexerTool() 56 { 57 } 58 59 60 /** --- 116 unchanged lines hidden (view full) --- 177 if( !bSrcDir ) 178 aSrcDirStr = aDirToZipStr; 179 File aCaptionFilesDir = new File( aSrcDirStr + File.separator + "caption" ); 180 File aContentFilesDir = new File( aSrcDirStr + File.separator + "content" ); 181 182 try 183 { 184 Date start = new Date(); | 46public class HelpIndexerTool 47{ 48 public HelpIndexerTool() 49 { 50 } 51 52 53 /** --- 116 unchanged lines hidden (view full) --- 170 if( !bSrcDir ) 171 aSrcDirStr = aDirToZipStr; 172 File aCaptionFilesDir = new File( aSrcDirStr + File.separator + "caption" ); 173 File aContentFilesDir = new File( aSrcDirStr + File.separator + "content" ); 174 175 try 176 { 177 Date start = new Date(); |
| 185 Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer(); 186 IndexWriter writer = new IndexWriter( aIndexDir, analyzer, true ); | 178 Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAnalyzer(Version.LUCENE_29) : (Analyzer)new StandardAnalyzer(Version.LUCENE_29); 179 IndexWriter writer = new IndexWriter( NIOFSDirectory.open(aIndexDir), analyzer, true, IndexWriter.MaxFieldLength.LIMITED ); |
| 187 if( !bExtensionMode ) 188 System.out.println( "Lucene: Indexing to directory '" + aIndexDir + "'..." ); 189 int nRet = indexDocs( writer, aModule, bExtensionMode, aCaptionFilesDir, aContentFilesDir ); 190 if( nRet != -1 ) 191 { 192 if( !bExtensionMode ) 193 { 194 System.out.println(); --- 212 unchanged lines hidden --- | 180 if( !bExtensionMode ) 181 System.out.println( "Lucene: Indexing to directory '" + aIndexDir + "'..." ); 182 int nRet = indexDocs( writer, aModule, bExtensionMode, aCaptionFilesDir, aContentFilesDir ); 183 if( nRet != -1 ) 184 { 185 if( !bExtensionMode ) 186 { 187 System.out.println(); --- 212 unchanged lines hidden --- |