fix logging
This commit is contained in:
parent
802e8d12bd
commit
7607a66e0e
@ -107,7 +107,7 @@ curl -XPOST http://localhost:9200/index/fulltext/_mapping -d'
|
||||
}'
|
||||
</pre>
|
||||
|
||||
3.indexing some docs
|
||||
3.index some docs
|
||||
|
||||
<pre>
|
||||
|
||||
|
4
pom.xml
4
pom.xml
@ -6,7 +6,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch-analysis-ik</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.2</version>
|
||||
<packaging>jar</packaging>
|
||||
<description>IK Analyzer for ElasticSearch</description>
|
||||
<inceptionYear>2009</inceptionYear>
|
||||
@ -31,7 +31,7 @@
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<elasticsearch.version>0.19.4</elasticsearch.version>
|
||||
<elasticsearch.version>0.19.8</elasticsearch.version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<assembly>
|
||||
<id></id>
|
||||
<id>ik</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
|
@ -3,27 +3,22 @@
|
||||
*/
|
||||
package org.wltea.analyzer.cfg;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.InvalidPropertiesFormatException;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.elasticsearch.common.logging.ESLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.wltea.analyzer.dic.Dictionary;
|
||||
import org.wltea.analyzer.seg.CJKSegmenter;
|
||||
import org.wltea.analyzer.seg.ISegmenter;
|
||||
import org.wltea.analyzer.seg.LetterSegmenter;
|
||||
import org.wltea.analyzer.seg.QuantifierSegmenter;
|
||||
|
||||
import static org.wltea.analyzer.dic.Dictionary.*;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.InvalidPropertiesFormatException;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import static org.wltea.analyzer.dic.Dictionary.getInstance;
|
||||
|
||||
public class Configuration {
|
||||
|
||||
|
@ -3,22 +3,16 @@
|
||||
*/
|
||||
package org.wltea.analyzer.dic;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.elasticsearch.common.logging.ESLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.wltea.analyzer.cfg.Configuration;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class Dictionary {
|
||||
|
||||
public static final String PATH_DIC_MAIN = "ik/main.dic";
|
||||
@ -128,10 +122,12 @@ public class Dictionary {
|
||||
for(String extDictName : extDictFiles){
|
||||
|
||||
File tempFile=new File(environment.configFile(),extDictName);
|
||||
|
||||
try {
|
||||
is = new FileInputStream(tempFile);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
logger.error("[Dict Loading]",e);
|
||||
}
|
||||
|
||||
if(is == null){
|
||||
@ -149,7 +145,7 @@ public class Dictionary {
|
||||
_MainDict.fillSegment(theWord.trim().toCharArray());
|
||||
}
|
||||
} while (theWord != null);
|
||||
logger.info("[Dict Loading] {},MainDict Size:{}",file.toString(),_MainDict.getDicNum());
|
||||
logger.info("[Dict Loading] {},MainDict Size:{}",tempFile.toString(),_MainDict.getDicNum());
|
||||
} catch (IOException ioe) {
|
||||
System.err.println("Extension Dictionary loading exception.");
|
||||
ioe.printStackTrace();
|
||||
|
Loading…
x
Reference in New Issue
Block a user