随笔分类 -  lucene

lucene 查询的使用
摘要:各种查询 方式一:使用QueryParser与查询语法。(会使用分词器) MultiFieldQueryParser 查询字符串 ------------------------> Query对象 例如: 上海 AND 天气 上海 OR 天气 上海新闻... 阅读全文
posted @ 2014-06-19 15:30 wf110 阅读(7097) 评论(0) 推荐(0)
lucene 过滤结果
摘要:1 package cn.itcast.h_filter; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 6 import org.apache.lucene.document.Document; 7 import org... 阅读全文
posted @ 2014-06-19 15:28 wf110 阅读(761) 评论(0) 推荐(0)
搜索结果排序
摘要:3,排序 默认是相关度排序。 也可以按指定的字段排序。 1 package cn.itcast.g_sort; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 6 import org.apache.lucene.... 阅读全文
posted @ 2014-06-19 15:17 wf110 阅读(435) 评论(0) 推荐(0)
高亮显示,其实就是加入样式
摘要:高亮 作用: 截取一段摘要 高亮显示其中的关键字 配置: 摘要大小(字数) 关键字的高亮效果(前缀、后缀,示例:关键字) 代码: 1 package cn.itcast.f_highlight; 2 3 import java.util.ArrayList; 4 import java.u... 阅读全文
posted @ 2014-06-19 15:07 wf110 阅读(1324) 评论(0) 推荐(0)
lucene 分词器
摘要:分词器 作用:切分关键词的。 在什么地方使用到了:在建立索引和搜索时。 原文:An IndexWriter creates and maintains an index. 1,切分: An IndexWriter creates and maintains an index... 阅读全文
posted @ 2014-06-19 14:43 wf110 阅读(384) 评论(0) 推荐(0)
lucene 建立CRUD操作
摘要:IndexSearcher indexSearcher = new IndexSearcher(LuceneUtils.getDirectory()); // 指定所用的索引库这句会引发线程安全问题,在全剧终 IndexSearcher只能有一个对象才可以,所以在ArticleDocumentUti... 阅读全文
posted @ 2014-06-18 20:31 wf110 阅读(1134) 评论(0) 推荐(0)
lucene示例
摘要:搭建环境搭建Lucene的开发环境只需要加入Lucene的Jar包,要加入的jar包至少要有: lucene-core-3.0.1.jar(核心包) contrib\analyzers\common\lucene-analyzers-3.0.1.jar(分词器) contrib\highlighte... 阅读全文
posted @ 2014-06-18 16:37 wf110 阅读(314) 评论(0) 推荐(0)