10 Commits

Author SHA1 Message Date
magese 2ebf31fed5 Update README.md 2019-05-27 13:23:53 +08:00
magese fd35153cce Update lucene to 8.1.0 2019-05-27 10:23:32 +08:00
magese 48a0234bb6 更新搜狗2019流行词汇; 2019-05-27 10:21:00 +08:00
magese a00336d239 Update README.md 2019-05-15 13:28:47 +08:00
magese 32d874b1ba Merge remote-tracking branch 'origin/master' 2019-05-15 10:38:25 +08:00
magese 7b0d009d32 support solr 8.0.0 2019-05-15 10:37:29 +08:00
Magese e3695f9192 Create CONTRIBUTING.md 2019-03-01 15:02:32 +08:00
Magese 33ac83d619 Update issue templates 2019-03-01 15:01:25 +08:00
magese fa1451042b Update README.md 2019-03-01 09:08:22 +08:00
magese c2e408473a Update Lucene version to 7.7.1 2019-02-28 09:46:10 +08:00
29 changed files with 15616 additions and 122 deletions
+38
View File
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
+1
View File
@@ -0,0 +1 @@
+18 -12
View File
@@ -1,18 +1,18 @@
# ik-analyzer-solr7
ik-analyzer for solr7.x
# ik-analyzer-solr
ik-analyzer for solr 7.x-8.x
<!-- Badges section here. -->
[![GitHub version](https://img.shields.io/maven-central/v/com.github.magese/ik-analyzer.svg?style=flat-square)](https://search.maven.org/search?q=g:com.github.magese%20AND%20a:ik-analyzer&core=gav)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/magese/ik-analyzer-solr7/releases)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/magese/ik-analyzer-solr/releases)
[![Crates.io](https://img.shields.io/crates/l/rustc-serialize.svg)](./LICENSE)
[![Build Status](https://travis-ci.org/magese/ik-analyzer-solr7.svg?branch=master)](https://travis-ci.org/magese/ik-analyzer-solr7)
[![Build Status](https://travis-ci.org/magese/ik-analyzer-solr.svg?branch=master)](https://travis-ci.org/magese/ik-analyzer-solr)
[![GitHub forks](https://img.shields.io/github/forks/magese/ik-analyzer-solr7.svg?style=social&label=Fork)](https://github.com/magese/ik-analyzer-solr7/fork)
[![GitHub stars](https://img.shields.io/github/stars/magese/ik-analyzer-solr7.svg?style=social&label=Star)](https://github.com/magese/ik-analyzer-solr7/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/magese/ik-analyzer-solr.svg?style=social&label=Fork)](https://github.com/magese/ik-analyzer-solr/network/members)
[![GitHub stars](https://img.shields.io/github/stars/magese/ik-analyzer-solr.svg?style=social&label=Star)](https://github.com/magese/ik-analyzer-solr/stargazers)
<!-- /Badges section end. -->
## 简介
#### 适配最新版本solr7
#### 适配最新版本solr 7&8
#### 扩展IK原有词库:
| 分词工具 | 词库中词的数量 | 最后更新时间 |
| :------: | :------: | :------: |
@@ -21,15 +21,15 @@ ik-analyzer for solr7.x
| word | 64.2万 | 2014年 |
| jieba | 58.4万 | 2012年 |
| jcesg | 16.6万 | 2018年 |
| sougou词库 | 115.2万 | 2018年 |
#### 将以上词库进行整理后约188.5万条词汇;
| sougou词库 | 115.2万 | 2019年 |
#### 将以上词库进行整理后约187.1万条词汇;
#### 添加动态加载词典表功能,在不需要重启solr服务的情况下加载新增的词典。
* IKAnalyzer的原作者为林良益<linliangyi2007@gmail.com>,项目网站为<http://code.google.com/p/ik-analyzer>
* 该项目动态加载功能根据博主[@星火燎原智勇](http://www.cnblogs.com/liang1101/articles/6395016.html)的博客进行修改,其GITHUB地址为[@liang68](https://github.com/liang68)
## 使用说明
* jar包下载地址:[![GitHub version](https://img.shields.io/badge/version-7.7.0-519dd9.svg)](https://search.maven.org/remotecontent?filepath=com/github/magese/ik-analyzer/7.7.0/ik-analyzer-7.7.0.jar)
* jar包下载地址:[![GitHub version](https://img.shields.io/badge/version-8.1.0-519dd9.svg)](https://search.maven.org/remotecontent?filepath=com/github/magese/ik-analyzer/8.1.0/ik-analyzer-8.1.0.jar)
* 历史版本:[![GitHub version](https://img.shields.io/maven-central/v/com.github.magese/ik-analyzer.svg?style=flat-square)](https://search.maven.org/search?q=g:com.github.magese%20AND%20a:ik-analyzer&core=gav)
```console
@@ -37,7 +37,7 @@ ik-analyzer for solr7.x
<dependency>
<groupId>com.github.magese</groupId>
<artifactId>ik-analyzer</artifactId>
<version>7.7.0</version>
<version>8.1.0</version>
</dependency>
```
@@ -91,6 +91,12 @@ ik-analyzer for solr7.x
## 更新说明
- `2019-05-27:`
- 升级lucene版本为`8.1.0`
- 优化原词典部分重复词语
- 更新搜狗2019最新流行词汇词典,约20k词汇量
- `2019-05-15:` 升级lucene版本为`8.0.0`,并支持Solr8使用
- `2019-03-01:` 升级lucene版本为`7.7.1`
- `2019-02-15:` 升级lucene版本为`7.7.0`
- `2018-12-26:`
- 升级lucene版本为`7.6.0`
@@ -109,7 +115,7 @@ ik-analyzer for solr7.x
## 感谢 Thanks
[![IDEA](./img/jetbrains.svg)](https://www.jetbrains.com/?from=ik-analyzer-solr7)
[![IDEA](./img/jetbrains.svg)](https://www.jetbrains.com/?from=ik-analyzer-solr)
[![forthebadge](https://forthebadge.com/images/badges/made-with-java.svg)](https://www.java.com)
+7 -7
View File
@@ -4,16 +4,16 @@
<groupId>com.github.magese</groupId>
<artifactId>ik-analyzer</artifactId>
<version>7.7.0</version>
<version>8.1.0</version>
<packaging>jar</packaging>
<name>ik-analyzer-solr7</name>
<name>ik-analyzer-solr</name>
<url>http://code.google.com/p/ik-analyzer/</url>
<description>IK-Analyzer for solr7.7</description>
<description>IK-Analyzer for solr 7-8</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<lucene.version>7.7.0</lucene.version>
<lucene.version>8.1.0</lucene.version>
<javac.src.version>1.8</javac.src.version>
<javac.target.version>1.8</javac.target.version>
<maven.compiler.plugin.version>3.3</maven.compiler.plugin.version>
@@ -55,9 +55,9 @@
</licenses>
<scm>
<tag>master</tag>
<url>https://github.com/magese/ik-analyzer-solr7</url>
<connection>scm:git:git@github.com:magese/ik-analyzer-solr7.git</connection>
<developerConnection>scm:git:git@github.com:magese/ik-analyzer-solr7.git</developerConnection>
<url>https://github.com/magese/ik-analyzer-solr</url>
<connection>scm:git:git@github.com:magese/ik-analyzer-solr.git</connection>
<developerConnection>scm:git:git@github.com:magese/ik-analyzer-solr.git</developerConnection>
</scm>
<developers>
<developer>
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.cfg;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.cfg;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.dic;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.dic;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.dic;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.lucene;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.lucene;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.lucene;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.lucene;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.query;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.query;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.sample;
@@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 7.7
* IK Analyzer release 7.7
* IK 中文分词 版本 8.1.0
* IK Analyzer release 8.1.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,8 +21,8 @@
* 版权声明 2012,乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 7.7版本 由 Magese (magese@live.cn) 更新
* release 7.7 update by Magese(magese@live.cn)
* 8.1.0版本 由 Magese (magese@live.cn) 更新
* release 8.1.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.sample;
@@ -39,10 +39,7 @@ import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.*;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;
import org.wltea.analyzer.lucene.IKAnalyzer;
@@ -107,10 +104,11 @@ public class LuceneIndexAndSearchDemo {
//搜索相似度最高的5条记录
TopDocs topDocs = isearcher.search(query, 5);
System.out.println("命中:" + topDocs.totalHits);
long totalHits = topDocs.totalHits.value;
System.out.println("命中:" + totalHits);
//输出结果
ScoreDoc[] scoreDocs = topDocs.scoreDocs;
for (int i = 0; i < topDocs.totalHits; i++) {
for (int i = 0; i < totalHits; i++) {
Document targetDoc = isearcher.doc(scoreDocs[i].doc);
System.out.println("内容:" + targetDoc.toString());
}
File diff suppressed because it is too large Load Diff