
lucene
TanaStudy
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
lucene实现全文检索(六):目录检索
getFieldName() 方法获取文档目录路径 /*** * * @param * @return fieldname * @throws */ public static String getFieldName(){ Scanner sc = new Scanner(System.in); System.out.println(" Please Enter fieldname:"); St原创 2021-04-08 23:11:22 · 3032 阅读 · 0 评论 -
lucene实现全文检索(五):索引检索
indexSearch()方法是对拆词后的字符集合进行索引检索 /** * * @param indexPath 索引目录 * @param searchStr 拆词后的字符集合 * @param limit 查询条数 * @throws IOException * @return */ public static ArrayList<String> indexSearch(String indexPath, Lis原创 2021-04-08 21:05:22 · 3042 阅读 · 2 评论 -
lucene实现全文检索(四):分词器
doToken()方法可以对传入的字符串进行分词 /*** * * @param ts 需要拆词的字符串 * @return * @throws IOException */ public static List<String> doToken(TokenStream ts) throws IOException { List<String> stringList = new ArrayList<>原创 2021-04-08 20:58:15 · 3094 阅读 · 0 评论 -
lucene 实现全文检索(三):删除索引
重复生成索引会造成索引重复,indexDelAll()方法可以删除掉索引目录下的所有索引/** * 删除指定索引库下面的所有 索引数据 * @param indexDir */ public static void indexDelAll(File indexDir) throws IOException { if (indexDir == null || !indexDir.exists() || indexDir.isFile()) {原创 2021-04-07 22:16:17 · 3352 阅读 · 0 评论 -
lucene 实现全文检索(二):创建索引
indexCreate()方法可以对每种类型的文档建立索引 /*** * 创建索引 * @param targetFileDir 源文件夹 * @param indexSaveDir 索引存放文件夹 * @throws IOException */ public static void indexCreate(File targetFileDir, File indexSaveDir) throws IOException, InvalidF原创 2021-04-07 22:12:47 · 3368 阅读 · 0 评论 -
lucene 实现全文检索(一):需求和项目创建
需求使用Lucene的API接口,设计并实现一个小型的信息检索系统;支持的文档类型有:txt、doc、pdf、html、ppt、xls和xml;支持中英文文档内容和文档元数据; 准备工作创建一个Meavn项目在pom.xml中导入下面这些依赖<dependencies> <!-- lucene 核心模块 --> <dependency> <groupId>org.apa原创 2021-04-07 21:58:16 · 1140 阅读 · 4 评论